feat(uniapp_v2): 二开功能迁移与小程序主包优化

- 从 uniapp 迁移 HJF 页面、API、组件及用户/订单相关改动
- queue、assets 使用独立分包以降低主包体积
- 修复首页单根节点与支付结果页 v-if 链
- 关闭 HjfDemoPanel 全局注册;uniNoticeBar 注释 $getAppWebview 避免 __webviewId__ 报错
- 配置域名与 manifest 应用名称;cache/store 防御性处理

Made-with: Cursor
This commit is contained in:
apple
2026-03-26 12:16:01 +08:00
parent c84aeda062
commit 8e17762510
742 changed files with 184117 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
### 企业微信侧边栏
#### 注意事项
- 只能在h5端运行小程序和APP不支持
- 需要对接企业微信SDK才能获取到用户信息
- 企业微信开发者文档 [文档地址](https://developer.work.weixin.qq.com/document/path/90514/)
- 项目根目录下的index.html中引用的CDN为了实现这些页面的相关功能

View File

@@ -0,0 +1,85 @@
<template>
<!-- 企业温馨导航 -->
<view class="tab_nav">
<view class="tab_list acea-row row-between">
<view class="tab_nav_item acea-row row-center row-column row-middle"
:class="active == 0 ? 'on' : ''" @click="switchTab(0)">
<text class="iconfont" :class="active == 0 ? 'icon-kehu-xuanzhong' : 'icon-kehu'" ></text>
<span>客户</span>
</view>
<view class="tab_nav_item acea-row row-center row-column row-middle"
:class="active == 1 ? 'on' : ''" @click="switchTab(1)">
<text class="iconfont " :class="active == 1 ? 'icon-dingdan-xuanzhong' : 'icon-dingdan1'"></text>
<span>订单</span>
</view>
<view class="tab_nav_item acea-row row-center row-column row-middle"
:class="active == 2 ? 'on' : ''" @click="switchTab(2)">
<text class="iconfont" :class="active == 2 ? 'icon-zuji-xuanzhong' : 'icon-zuji'"></text>
<span>足迹</span>
</view>
<slot name="bottom"></slot>
</view>
</view>
</template>
<script>
export default{
data() {
return {
active1:this.active
}
},
props:{
active:{
type:Number,
default:0
}
},
methods:{
switchTab(index){
// this.active = index;
let userid = this.$Cache.get('work_user_id')
if(index == 0){
uni.reLaunch({
url:'/pages/work/userInfo/index?userid=' + userid
})
}else if(index == 1){
uni.reLaunch({
url:'/pages/work/orderList/index'
})
}else if(index == 2){
uni.reLaunch({
url:'/pages/work/record/index'
})
}
}
}
}
</script>
<style lang="scss">
.tab_nav{
width: 100%;
position: fixed;
bottom: 0;
left: 0;
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
}
.tab_nav_item{
width: 33.3%;
height: 100rpx;
background: #fff;
.title{
color: #1A1A1A;
font-size: 24rpx;
}
.iconfont{
font-size: 36rpx;
}
}
.icon-kehu-xuanzhong,.icon-dingdan-xuanzhong,.icon-jilu-xuanzhong{
color: #1890FF;
}
.on{
color: #1890FF;
}
</style>

View File

@@ -0,0 +1,394 @@
<template>
<view class="group_info">
<!-- #ifdef H5 -->
<view class="top_bg"></view>
<view class="header_card acea-row row-middle">
<view class="pic">
<text class="iconfont icon-qunliao"></text>
</view>
<view class="name">
<view class="group_name">{{chatInfo.name}}</view>
<view class="desc">创建时间{{chatInfo.group_create_time}}</view>
</view>
</view>
<view class="static acea-row row-around row-middle">
<view class="item">
<view class="num">{{chatInfo.member_num}}</view>
<view class="title">当前群成员</view>
</view>
<view class="item v_line">
<view class="num">{{chatInfo.todaySum}}</view>
<view class="title">今日入群</view>
</view>
<view class="item v_line">
<view class="num">{{chatInfo.retreat_group_num}}</view>
<view class="title">累计退群</view>
</view>
</view>
<view class="list">
<view class="search">
<input type="text" v-model="name"
class="search" placeholder="点击搜索客户名称"
placeholder-class="pla_name" @blur="search()">
</view>
<view class="item" v-for="(item,index) in userList" :key="index" @click="toInfo(item)">
<view class="item-info acea-row row-between row-top" >
<view class="pictrue">
<image v-if="item.type == 1 && item.member" :src="item.member.avatar"></image>
<image v-if="item.type == 2 && item.client" :src="item.client.avatar"></image>
</view>
<view class="conten">
<view class="name line1" v-if="item.type == 1 && item.member">{{item.member.name}}
<text class="iconfont" :class="item.member.gender == 1 ? 'icon-xingbie-nan' : 'icon-xingbie-nv'"></text>
</view>
<view class="name line1" v-if="item.type == 2 && item.client">{{item.client.name}}
<text class="iconfont" :class="item.client.gender == 1 ? 'icon-xingbie-nan' : 'icon-xingbie-nv'"></text>
</view>
<text class="label" v-if="item.type == 1">{{item.userid == chatInfo.owner ? "群主" : "成员"}}</text>
<text class="label" v-if="item.type == 2">客户</text>
<text class="label_qita">其他所在群{{item.group_chat_num}}</text>
</view>
<view class="time">{{item.join_time}}</view>
</view>
<view class="desc line1" v-if="item.tags && item.tags.length">
标签<text v-for="(item1,index1) in item.tags" :key="index1">{{item1}},</text>
</view>
<view class="desc line1" v-else>
标签暂无
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import { initWxConfig,initAgentConfig } from "@/libs/work.js";
import {getWorkGroupInfo,getWorkGroupMember} from "@/api/work.js"
import Loading from '@/components/Loading/index.vue';
// import {wx} from "@/utils/agent.js"
export default{
data() {
return {
// chat_id:"wrPuqMEwAARnzYsua0WJgATVYu4b3iUg",
chat_id:"",
chatInfo:{},
loaded: false,
loading: false, //是否加载中
loadend: false, //是否加载完毕
loadTitle: '加载更多', //提示语
userList: [], //数组
page: 1,
limit: 20,
name:"",
}
},
components:{Loading},
onLoad(e) {
if(e.back){
this.chat_id = this.$Cache.get('chatId');
if(this.$Cache.get('chatId')){
this.getInfo();
}else{
uni.navigateBack();
return this.$util.Tips({
title: "缺少参数"
});
}
}else{
initWxConfig().then((jWeixin) => {
// initAgentConfig().then(res=>{
this.getChatID();
// })
}).catch((err) => {
return that.$util.Tips({
title: err
});
});
}
// this.getInfo();
},
methods:{
getChatID(){
if (/(iPhone|iPad|iPod|iOS|macintosh|mac os x)/i.test(navigator.userAgent)){
wx.invoke('getContext', {}, (res)=>{
if(res.err_msg == "getContext:ok"){
let entry = res.entry ;
//返回进入H5页面的入口类型
//目前有normal、contact_profile、single_chat_tools、group_chat_tools、chat_attachment
wx.invoke('getCurExternalChat', {entry}, (response)=>{
if(response.err_msg == "getCurExternalChat:ok"){
this.chat_id = response.chatId;
this.getInfo();
}
});
}
});
}else{
jWeixin.invoke('getContext', {}, (res)=>{
if(res.err_msg == "getContext:ok"){
let entry = res.entry ;
//返回进入H5页面的入口类型
//目前有normal、contact_profile、single_chat_tools、group_chat_tools、chat_attachment
jWeixin.invoke('getCurExternalChat', {entry}, (response)=>{
if(response.err_msg == "getCurExternalChat:ok"){
this.chat_id = response.chatId;
this.getInfo();
}
});
}
});
}
},
getInfo(){
getWorkGroupInfo({chat_id:this.chat_id}).then(res=>{
this.chatInfo = res.data;
this.getList();
}).catch(err=>{
return this.$util.Tips({
title: err
});
})
},
getList(){
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '加载更多';
getWorkGroupMember(that.chatInfo.id,{
page:this.page,
limit:this.limit,
name:this.name
}).then(res=>{
let list = res.data.list || [];
let loadend = list.length < that.limit;
that.userList = that.$util.SplitArray(list, that.userList);
that.$set(that, 'userList', that.userList);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page = that.page + 1;
}).catch(err=>{
return that.$util.Tips({
title: err
});
})
},
search(){
if(this.loading) return
this.loadend = false;
this.page = 1;
this.$set(this, 'userList', []);
this.getList();
},
toInfo(item){
if(item.type == 2){
this.$Cache.set('chatId',this.chat_id);
uni.navigateTo({
url:"/pages/work/userInfo/index?userid=" + item.userid
})
}
}
},
onReachBottom: function() {
this.getList();
}
}
// #endif
</script>
<style lang="scss">
/* #ifdef H5 */
.group_info{
.top_bg{
width: 750rpx;
height: 150rpx;
background: #1890FF;
}
.header_card{
width: 710rpx;
height: 168rpx;
margin: -126rpx auto 0;
background: #FFFFFF;
border-radius: 12rpx;
padding: 28rpx 24rpx;
.pic{
width: 112rpx;
height: 112rpx;
border-radius: 50%;
background: #E1F1FF;
text-align: center;
line-height: 112rpx;
.iconfont{
font-size: 50rpx;
color: #1890FF;
}
}
.name{
margin-left:20rpx;
.group_name{
height: 44rpx;
font-size: 32rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 44rpx;
}
.desc{
height: 32rpx;
font-size: 22rpx;
font-weight: 400;
color: rgba(102, 102, 102, 0.85);
line-height: 32rpx;
margin-top: 6rpx;
}
}
}
.static{
width: 710rpx;
height: 172rpx;
background: #FFFFFF;
border-radius: 12rpx;
margin: 20rpx auto 0;
.item{
text-align: center;
width: 33.3%;
.num{
height: 56rpx;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 56rpx;
}
.title{
height: 32rpx;
font-size: 22rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(102, 102, 102, 0.85);
line-height: 32rpx;
margin-top: 12rpx;
}
}
.v_line{
position: relative;
&::before{
content: '';
position: absolute;
left: 0;
top:23rpx;
width: 1px;
height: 80rpx;
background-color: #eee;
}
}
}
.list{
width: 710rpx;
margin: 20rpx auto 0;
background: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx 24rpx;
.search{
width: 642rpx;
height: 64rpx;
margin:0 auto 0;
line-height: 64rpx;
background: #F5F6F9;
border-radius: 32rpx;
padding-left:20rpx ;
font-size: 28rpx;
}
.pla_name{
font-size: 28rpx;
text-align: center;
font-weight: 400;
color: #CCCCCC;
}
.item {
margin-top: 32rpx;
padding-bottom: 28rpx;
border-bottom: 1px solid #eee;
}
.item-info .pictrue {
width: 100rpx;
height: 100rpx;
}
.item-info .pictrue image {
width: 100%;
height: 100%;
border-radius: 8rpx;
}
.conten{
width: 296rpx;
margin-left:22rpx;
.name{
height: 42rpx;
font-size: 30rpx;
font-weight: 600;
color: #000;
line-height: 42rpx;
}
.iconfont{
font-size: 26rpx;
font-weight: 400;
display: inline-block;
margin-left: 8rpx;
}
.icon-xingbie-nan{
color: #1890FF;
}
.icon-xingbie-nv{
color: #E369A2;
}
.label{
display: inline-block;
margin:10rpx 12rpx 0 0;
height: 38rpx;
padding: 0 12rpx 0;
background: rgba(24, 144, 255, 0.1);
border-radius: 4rpx;
border: 1px solid #1890FF;
// line-height: 44rpx;
text-align: center;
font-size: 24rpx;
color: #1890FF;
}
.label_qita{
display: inline-block;
margin:10rpx 12rpx 0 0;
height: 38rpx;
padding: 0 12rpx 0;
border-radius: 4rpx;
border: 1rpx solid #ccc;
// line-height: 44rpx;
text-align: center;
font-size: 24rpx;
color: #999;
}
}
.time{
font-size: 24rpx;
}
.desc{
width: 460rpx;
height: 34rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
line-height: 34rpx;
margin-top: 24rpx;
}
}
}
/* #endif */
</style>

View File

@@ -0,0 +1,533 @@
<template>
<view class="order-details">
<!-- #ifdef H5 -->
<!-- 给header上与data上加on为退款订单-->
<view class="nav_bar">
订单详情
<navigator url="/pages/work/orderList/index">
<text class="iconfont icon-fanhui2"></text>
</navigator>
</view>
<view class='header acea-row row-middle' :class='isGoodsReturn ? "on":""'>
<view class='pictrue' v-if="isGoodsReturn==false">
<image :src="orderInfo.status_pic"></image>
</view>
<view class='data' :class='isGoodsReturn ? "on":""'>
<view class='state'>{{title}}</view>
<view>{{orderInfo._add_time }}</view>
</view>
</view>
<view class="address_info">
<view class="user_top acea-row row-middle" v-if="orderInfo.real_name">
<text class="iconfont icon-yonghu2"></text>
<text class="order_name">{{ userInfo.nickname }}</text>
</view>
<view class="address" v-if="orderInfo.product_type == 0 && orderInfo.delivery_type !='fictitious'">
<view class="user">
<span>{{ orderInfo.real_name }}</span>
<span class="pl34">{{ orderInfo.user_phone }}</span>
</view>
<view class="detail">{{orderInfo.user_address }}</view>
</view>
</view>
<view class="list">
<view class="item-info acea-row row-between row-top" v-for="(item, index) in orderInfo.cartInfo" :key="index">
<view class="pictrue">
<image :src="item.productInfo.image"></image>
</view>
<view>
<view class="text acea-row row-between">
<view class="name line2">{{ item.productInfo.store_name }}</view>
<view class="money">{{ item.productInfo.attrInfo.price }}
<view class="cart_num">x{{ item.cart_num }}</view>
</view>
</view>
<view class="sku line1" v-if="item.productInfo.attrInfo.suk">
{{ item.productInfo.attrInfo.suk }}
</view>
</view>
</view>
<view class="public-total">
{{ orderInfo.total_num }}件商品实付款
<span class="money">{{ orderInfo.pay_price }}</span> ( 邮费 ¥{{ orderInfo.pay_postage}})
</view>
<div class='wrapper' v-if='orderInfo.delivery_type=="fictitious" && orderInfo.product_type!=1'>
<view class='item acea-row row-between'>
<view>虚拟发货</view>
<view class='conter'>已发货请注意查收</view>
</view>
<div class='item acea-row row-between'>
<div>虚拟备注</div>
<div class='conter'>{{orderInfo.fictitious_content}}</div>
</div>
</div>
<div class='wrapper' v-if="orderInfo.virtual_info && orderInfo.product_type==1">
<div class='item acea-row row-between'>
<div>卡密发货</div>
<div class='conter'>{{orderInfo.virtual_info}}</div>
</div>
</div>
<!-- <div class='wrapper' style="border-bottom: 1px solid #eee;" v-if="orderInfo.custom_form && orderInfo.custom_form.length">
<div class='item acea-row row-between' v-for="(item,index) in orderInfo.custom_form" :key="index" v-if="item.value">
<div>{{item.title}}</div>
<div v-if="item.label == 'img'" class='conter'>
<div class='pictrue' v-for="(img,indexn) in item.value" :key="indexn">
<image :src='img'/>
</div>
</div>
<div v-if="item.label != 'img'" class='conter'>{{item.value}}</div>
</div>
</div> -->
<view class='wrapper'>
<view class='item acea-row row-between'>
<view>订单编号</view>
<view class='conter'> {{ orderInfo.order_id}}
<text class="copy copy-data" @tap="copy(orderInfo.order_id)">复制</text>
</view>
</view>
<div class="item acea-row row-between">
<div>支付时间</div>
<div class="conter">{{ orderInfo._pay_time }}</div>
</div>
<div class="item acea-row row-between">
<div>支付状态</div>
<div class="conter">{{ orderInfo.paid ? '已支付' : '未支付' }}</div>
</div>
<div class="item acea-row row-between">
<div>支付方式</div>
<div class="conter">{{ orderInfo._status?orderInfo._status._payType:'' }}</div>
</div>
<div class="item acea-row row-between" v-if="orderInfo.mark">
<div v-if="isReturen == 1">退款留言</div>
<div v-else>买家留言</div>
<div class="conter">{{ orderInfo.mark }}</div>
</div>
<div class="item acea-row row-between" v-if="orderInfo.refund_goods_explain">
<div>退货留言</div>
<div class='conter'>{{orderInfo.refund_goods_explain}}</div>
</div>
<div class="item acea-row row-between" v-if="orderInfo.refund_img && orderInfo.refund_img.length">
<div>退款凭证</div>
<div class="conter">
<div class="pictrue" v-for="(item,index) in orderInfo.refund_img" :key="index">
<image :src="item" mode="aspectFill"/>
</div>
</div>
</div>
<div class="item acea-row row-between" v-if="orderInfo.refund_goods_img && orderInfo.refund_goods_img.length">
<div>退货凭证</div>
<div class="conter">
<div class="pictrue" v-for="(item,index) in orderInfo.refund_goods_img" :key="index">
<image :src="item" mode="aspectFill"/>
</div>
</div>
</div>
</view>
<div class="wrapper">
<div class="item acea-row row-between">
<div>商品总价</div>
<div class="conter">{{ orderInfo.total_price }}</div>
</div>
<div class="item acea-row row-between">
<div>优惠券抵扣</div>
<div class="conter">-{{ orderInfo.coupon_price }}</div>
</div>
<div class="item acea-row row-between">
<div>优惠活动金额</div>
<div class="conter">-{{ orderInfo.promotions_price }}</div>
</div>
<div class="item acea-row row-between">
<div>运费</div>
<div class="conter">{{ orderInfo.pay_postage }}</div>
</div>
<div class="actualPay acea-row row-right">
实付款<span class="money font-color-red">{{ orderInfo.pay_price }}</span>
</div>
</div>
<div class="wrapper" v-show="orderInfo.delivery_type">
<div class="item acea-row row-between">
<div>配送方式</div>
<div class="conter" v-if="orderInfo.delivery_type === 'express'">快递</div>
<div class="conter" v-if="orderInfo.delivery_type === 'send'">送货</div>
<div class="conter" v-if="orderInfo.delivery_type === 'cashier'">收银台</div>
<div class="conter" v-if="orderInfo.delivery_type === 'fictitious'">虚拟发货</div>
</div>
<div class="item acea-row row-between">
<div v-if="orderInfo.delivery_type === 'express'">快递公司</div>
<div v-if="orderInfo.delivery_type === 'send'">送货人</div>
<div class="conter">{{ orderInfo.delivery_name }}</div>
</div>
<div class="item acea-row row-between">
<div v-if="orderInfo.delivery_type === 'express'">快递单号</div>
<div v-if="orderInfo.delivery_type === 'send'">送货人电话</div>
<div class="conter" v-if="orderInfo.delivery_id">
{{ orderInfo.delivery_id}}
<span class="copy copy-data" @tap="copy(orderInfo.delivery_id)">复制</span>
</div>
</div>
</div>
<view style='height:20rpx;'></view>
<!-- <view class='footer acea-row row-right row-middle'>
<div class="more"></div>
<div class="bnt cancel" @click="modify(0)" v-if="types === 0">一键改价</div>
<div class="bnt cancel" @click="modify(2)" v-if="types === -1">立即退款</div>
<div class="bnt cancel" @click="modify(1)">订单备注</div>
<div class="bnt cancel"
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay">确认付款</div>
</view> -->
</view>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import {getWorkOrderInfo} from "@/api/work.js";
export default{
data() {
return {
userId:"",
title:"请等待",
isGoodsReturn:false,
types:"",
isReturen:0,
orderInfo:{},
userInfo:{}
}
},
onLoad(e) {
if(e){
this.order_id = e.id;
this.userId = this.$Cache.get('work_user_id')
this.getInfo();
}
},
methods:{
getInfo(){
let that = this;
getWorkOrderInfo(this.order_id,{userid:this.userId,}).then(res=>{
that.orderInfo = res.data.orderInfo;
that.userInfo = res.data.userInfo;
that.types = res.data.orderInfo._status._type;
that.title = res.data.orderInfo._status._title;
}).catch(err=>{
return that.$util.Tips({
title: err
});
})
},
copy(value){
let that = this;
uni.setClipboardData({
data: value
});
}
}
}
// #endif
</script>
<style lang="scss">
/* #ifdef H5 */
.order-details .nav_bar{
height: 88rpx;
line-height: 88rpx;
background: #1890FF;
color: #fff;
font-size: 32rpx;
text-align: center;
position: relative;
.icon-fanhui2{
position: absolute;
left: 12rpx;
top: 50%;
transform: translate(0, -50%);
}
}
.order-details .header {
padding: 0 30rpx;
height: 150rpx;
display: flex;
align-items: center;
flex-wrap: nowrap;
background: #1890FF;
}
.order-details .header.on {
background-color: #666 !important;
}
.order-details .header .pictrue {
width: 110rpx;
height: 110rpx;
}
.order-details .header .pictrue image {
width: 100%;
height: 100%;
}
.order-details .header .data {
color: rgba(255, 255, 255, 0.8);
font-size: 24rpx;
margin-left: 27rpx;
}
.order-details .header .data.on {
margin-left: 0;
}
.order-details .header .data .state {
font-size: 30rpx;
font-weight: bold;
color: #fff;
margin-bottom: 7rpx;
}
.order-details .header .data .time {
margin-left: 20rpx;
}
.order-details .address_info{
width: 710rpx;
margin: 20rpx auto 0;
background: #FFFFFF;
border-radius: 12rpx;
background-image: url(../../../static/images/line.jpg);
background-repeat: no-repeat;
background-position: bottom;
.user_top{
height: 88rpx;
padding: 0 34rpx 0;
box-sizing: border-box;
border-bottom: 1px solid #f5f5f5;
.iconfont {
color: #1890FF;
font-size: 44rpx;
}
.order_name{
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
padding-left: 20rpx;
}
}
.address{
.user{
color: rgba(0, 0, 0, 0.85);
font-size: 28rpx;
padding: 26rpx 24rpx 12rpx;
box-sizing: border-box;
}
.detail{
color: #666666;
font-size: 28rpx;
padding: 0 24rpx 30rpx;
}
.pl34{
padding-left: 34rpx;
}
}
}
.list{
width: 710rpx;
margin: 20rpx auto 0;
}
.item-info {
padding: 30rpx 24rpx 30rpx;
background: #fff;
}
.item-info .pictrue {
width: 140rpx;
height: 140rpx;
}
.item-info .pictrue image {
width: 100%;
height: 100%;
border-radius: 8rpx;
}
.item-info .text {
width: 486rpx;
font-size: 28rpx;
color: #999;
}
.item-info .text .name {
width: 306rpx;
color: rgba(0, 0, 0, 0.85);
font-size: 28rpx;
height: 80rpx;
line-height: 40rpx;
margin-left: 22rpx;
}
.sku{
width: 306rpx;
margin: 26rpx 0 0 22rpx;
font-size: 24rpx;
color: #666;
}
.item-info .text .money {
width: 150rpx;
text-align: right;
color: rgba(0, 0, 0, 0.85);
}
.cart_num{
height: 40rpx;
font-size: 28rpx;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
line-height: 40rpx;
margin-top: 8rpx;
}
.item-info .text .money .return{
margin-top: 10rpx;
font-size: 24rpx;
}
.totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
margin: 27rpx 0 0 30rpx;
padding: 0 30rpx 30rpx 0;
border-bottom: 1rpx solid #eee;
}
.totalPrice .money {
font-size: 28rpx;
font-weight: bold;
color: #F5222D;
}
.public-total {
font-size: 28rpx;
color: #282828;
height: 92rpx;
line-height: 92rpx;
text-align: right;
padding: 0 24rpx;
background-color: #fff;
}
.public-total .money {
color: #F5222D;
}
.wrapper {
background-color: #fff;
padding: 36rpx 24rpx 16rpx;
margin-top: 20rpx;
border-radius: 12rpx;
}
.wrapper .item {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.85);
padding-bottom: 20rpx;
}
.wrapper .item .conter {
color: #868686;
display: flex;
flex-wrap: nowrap;
justify-content: flex-end;
text-align: right;
.pictrue{
width: 140rpx;
height: 140rpx;
margin-left: 20rpx;
image{
width: 100%;
height: 100%;
border-radius: 12rpx;
}
}
}
.footer {
width: 100%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding: 0 30rpx;
box-sizing: border-box;
.more {
position: absolute;
left: 30rpx;
font-size: 26rpx;
color: #333;
.icon-xiangshang {
margin-left: 6rpx;
font-size: 22rpx;
}
}
.more-box {
color: #333;
position: absolute;
left: 30rpx;
bottom: 110rpx;
background-color: #fff;
padding: 18rpx 24rpx;
border-radius: 4rpx;
font-size: 28rpx;
-webkit-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
-moz-box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
box-shadow: 0px 0px 3px 0px rgba(200, 200, 200, 0.75);
.more-btn {
color: #333;
padding: 4rpx;
z-index: 9999;
}
}
.more-box:before {
content: "";
width: 0rpx;
height: 0rpx;
border-top: 10rpx solid #fff;
border-bottom: 10rpx solid transparent;
border-left: 10rpx solid #fff;
position: absolute;
bottom: -10rpx;
left: 0px;
}
}
.footer .bnt {
width: 176rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 50rpx;
color: #fff;
font-size: 27rpx;
}
.footer .bnt.refundBnt {
width: 210rpx;
}
.footer .bnt.cancel {
color: #666;
border: 1rpx solid #ccc;
}
.footer .bnt~.bnt {
margin-left: 18rpx;
}
.copy {
font-size: 20rpx;
color: #333;
border-radius: 3rpx;
border: 1rpx solid #666;
padding: 3rpx 15rpx;
margin-left: 24rpx;
white-space: nowrap;
}
/* #endif */
</style>

View File

@@ -0,0 +1,316 @@
<template>
<view class="my-order">
<!-- #ifdef H5 -->
<view class="nav acea-row row-around">
<view class="item" :class="orderStatus === 0 ? 'on' : ''" @click="statusClick(0)">
<view>待付款</view>
</view>
<view class="item" :class="orderStatus == 1 ? 'on' : ''" @click="statusClick(1)">
<view>待发货</view>
</view>
<view class="item" :class="orderStatus == 2 ? 'on' : ''" @click="statusClick(2)">
<view>待收货</view>
</view>
<view class="item" :class="orderStatus == 3 ? 'on' : ''" @click="statusClick(3)">
<view>待评价</view>
</view>
<view class="item" :class="orderStatus == 4 ? 'on' : ''" @click="statusClick(4)">
<view>已完成</view>
</view>
<view class="item" :class="orderStatus == -3 ? 'on' : ''" @click="statusClick(-3)">
<view>退款</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<view class="list">
<view class="item" v-for="(item,index) in orderList" :key="index" @click="goOrderDetails(item.id)">
<view class="title acea-row row-between row-middle">
<view>
<view class="order_no">订单号{{item.order_id}}</view>
<view class="create_time">下单时间{{item._add_time}}</view>
</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 6">已退款</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 1">仅退款</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 2">退货退款</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 3">拒绝</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 4">同意退货</view>
<view class="sign" v-if="orderStatus == -3 && item.refund_type == 5">已退货</view>
<view class="sign" v-else>{{orderStatus | typeMsg}}</view>
</view>
<view class="item-info acea-row row-between row-top" v-for="(val, index1) in item.cartInfo" :key="index1">
<view class="pictrue">
<image :src="val.productInfo.image"></image>
</view>
<view>
<view class="text acea-row row-between">
<view class="name line2">{{ val.productInfo.store_name }}</view>
<view class="money">{{ val.productInfo.attrInfo.price }}
<view>x{{ val.cart_num }}</view>
</view>
</view>
<view class="sku line1" v-if="val.productInfo.attrInfo.suk">
{{ val.productInfo.attrInfo.suk }}
</view>
</view>
</view>
<view class="totalPrice">
{{ item.total_num }}件商品总金额
<text class="money">{{ item.pay_price }}</text>
</view>
</view>
</view>
<view v-if="orderList.length == 0 && !loading">
<emptyPage title="暂无订单信息~"></emptyPage>
</view>
<view class="ht100"></view>
<tNav :active="1"></tNav>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import {getWorkOrderList} from "@/api/work.js"
import Loading from '@/components/Loading/index.vue';
import emptyPage from '@/components/emptyPage.vue';
import tNav from '../components/tabNav.vue';
import {wx} from "@/utils/agent.js"
export default{
data() {
return {
userId:"",
loaded: false,
loading: false, //是否加载中
loadend: false, //是否加载完毕
loadTitle: '加载更多', //提示语
orderList: [], //订单数组
orderStatus: 0, //订单状态
page: 1,
limit: 10,
}
},
components:{Loading,tNav,emptyPage},
filters:{
typeMsg(value){
const statusMap = {
0: "待付款",
1: "待发货",
2: "待收货",
3: "待评价",
4: "已完成",
};
return statusMap[value];
}
},
onLoad() {
this.userId = this.$Cache.get('work_user_id')
this.getList();
},
methods:{
getUserID(){
wx.invoke('getContext', {}, (res)=>{
if(res.err_msg == "getContext:ok"){
let entry = res.entry ;
//返回进入H5页面的入口类型
//目前有normal、contact_profile、single_chat_tools、group_chat_tools、chat_attachment
wx.invoke('getCurExternalContact', {entry}, (response)=>{
if(response.err_msg == "getCurExternalContact:ok"){
//返回当前外部联系人userId
this.userId = response.userId;
this.getList();
}
});
}
});
},
statusClick(index){
if(this.loading) return
if (index === this.orderStatus) return;
this.orderStatus = index;
this.loadend = false;
this.page = 1;
this.$set(this, 'orderList', []);
this.getList();
},
getList(){
let that = this;
let params = {};
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '加载更多';
params = {
userid:that.userId,
page:that.page,
limit:that.limit,
type:that.orderStatus
}
getWorkOrderList(params).then(res=>{
let list = res.data || [];
let loadend = list.length < that.limit;
that.orderList = that.$util.SplitArray(list, that.orderList);
that.$set(that, 'orderList', that.orderList);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page = that.page + 1;
}).catch(err=>{
return that.$util.Tips({
title: err
});
})
},
goOrderDetails(id){
uni.navigateTo({
url:'/pages/work/orderDetail/index?id=' + id
})
}
},
onReachBottom: function() {
this.getList();
}
}
// #endif
</script>
<style lang="scss">
/* #ifdef H5 */
.nav {
width: 750rpx;
height: 92rpx;
background: #FFFFFF;
}
.nav .item {
text-align: center;
line-height: 92rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.nav .item.on {
font-weight: 400;
color: #1890FF;
}
.list {
width: 690rpx;
margin: 28rpx auto 0;
}
.list .item {
background-color: #fff;
border-radius: 12rpx;
margin-bottom: 28rpx;
}
.my-order .list .item .title {
height: 110rpx;
padding: 16rpx 24rpx 18rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #eee;
.order_no{
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 42rpx;
}
.create_time{
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 34rpx;
}
}
.my-order .list .item .title .sign {
color: #1890FF;
}
.my-order .list .item .item-info {
padding: 0 30rpx;
margin-top: 22rpx;
}
.my-order .list .item .item-info .pictrue {
width: 140rpx;
height: 140rpx;
}
.my-order .list .item .item-info .pictrue image {
width: 100%;
height: 100%;
border-radius: 8rpx;
}
.my-order .list .item .item-info .text {
width: 486rpx;
font-size: 28rpx;
color: #999;
}
.my-order .list .item .item-info .text .name {
width: 306rpx;
color: rgba(0, 0, 0, 0.85);
font-size: 28rpx;
height: 80rpx;
line-height: 40rpx;
margin-left: 22rpx;
}
.my-order .list .item .sku{
width: 280rpx;
margin: 26rpx 0 0 22rpx;
font-size: 24rpx;
color: #666;
}
.my-order .list .item .item-info .text .money {
text-align: right;
width: 150rpx;
}
.my-order .list .item .item-info .text .money .return{
margin-top: 10rpx;
font-size: 24rpx;
}
.my-order .list .item .totalPrice {
font-size: 26rpx;
color: #282828;
text-align: right;
margin: 27rpx 0 0 30rpx;
padding: 0 30rpx 30rpx 0;
border-bottom: 1rpx solid #eee;
}
.my-order .list .item .totalPrice .money {
font-size: 28rpx;
font-weight: bold;
color: #F5222D;
}
.my-order .list .item .bottom {
height: 107rpx;
padding: 0 30rpx;
}
.my-order .list .item .bottom .bnt {
width: 176rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
color: #fff;
border-radius: 50rpx;
font-size: 27rpx;
}
.my-order .list .item .bottom .bnt.cancelBnt {
border: 1rpx solid #ddd;
color: #aaa;
}
.my-order .list .item .bottom .bnt~.bnt {
margin-left: 17rpx;
}
.ht100{
height: 120rpx;
}
/* #endif */
</style>

View File

@@ -0,0 +1,381 @@
<template>
<view class="record">
<!-- #ifdef H5 -->
<view class="top_nav acea-row row-center-wrapper">
<view class="navCon acea-row row-middle">
<view class="text" :class="active == 0 ? 'on' : ''" @click="switchTab(0)">购买记录</view>
<view class="text" :class="active == 1 ? 'on2' : ''" @click="switchTab(1)">浏览记录</view>
</view>
</view>
<view class="search acea-row row-center row-middle">
<input type="text" v-model="keywords" class="search_input" placeholder="搜索商品" placeholder-class="text_gray"
@blur="search()">
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<view class="goods_list" v-if="goodsList.length">
<view class="item acea-row" v-for="(item,index) in goodsList" :key="index">
<view class="picture">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="goods_info acea-row row-column row-between">
<view class="name line2">{{item.store_name}}</view>
<view class="stork acea-row row-between">
<text>库存 {{item.stock}}</text>
<text>销量 {{item.sales}}</text>
<text class="pushFn" @click="pushFn(item)">推送</text>
</view>
</view>
<view class="price_info acea-row row-column row-between">
<text class="price">{{item.price}}</text>
</view>
</view>
</view>
<view class="empty-box" v-else>
<image src="../static/shop_record.png" v-if="active == 0"></image>
<image src="../static/view_record.png" v-if="active == 1"></image>
<view>暂无 {{active ? '浏览' : '购买'}}记录</view>
</view>
<view class="ht100"></view>
<tNav :active="2"></tNav>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import tNav from '../components/tabNav.vue';
import Loading from '@/components/Loading/index.vue';
import {
initWxConfig,
initAgentConfig,
} from "@/libs/work.js";
import {
getWorkCartList,
getWorkVisitInfo,
getWorkAgentConfig
} from "@/api/work.js"
// import {
// wx
// } from "@/utils/agent.js"
export default {
data() {
return {
keywords: "",
userId: "",
loaded: false,
loading: false, //是否加载中
loadend: false, //是否加载完毕
loadTitle: '加载更多', //提示语
goodsList: [], //商品数组
active: 0, //选项状态
page: 1,
limit: 10,
}
},
components: {
Loading,
tNav
},
onLoad() {
this.userId = this.$Cache.get('work_user_id')
this.getList();
getWorkAgentConfig(window.location.href.split('#')[0]).then(res => {
if (/(iPhone|iPad|iPod|iOS|macintosh|mac os x)/i.test(navigator.userAgent)){
wx.agentConfig({
corpid: res.data.corpid, // 必填企业微信的corpid必须与当前登录的企业一致
agentid: res.data.agentid, // 必填企业微信的应用id e.g. 1000247
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ["getCurExternalContact", "getCurExternalChat", "getContext", "chooseImage", "sendChatMessage", ],
success: function(res) {
// console.log(res);
},
});
}else{
jWeixin.agentConfig({
corpid: res.data.corpid, // 必填企业微信的corpid必须与当前登录的企业一致
agentid: res.data.agentid, // 必填企业微信的应用id e.g. 1000247
timestamp: res.data.timestamp, // 必填,生成签名的时间戳
nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ["getCurExternalContact", "getCurExternalChat", "getContext", "chooseImage", "sendChatMessage", ],
success: function(res) {
// console.log(res);
},
});
}
})
},
methods: {
// 推送到商品详情
pushFn(item) {
if (/(iPhone|iPad|iPod|iOS|macintosh|mac os x)/i.test(navigator.userAgent)){
wx.invoke('sendChatMessage', {
msgtype: "news", //消息类型,必填
enterChat: true, //为true时表示发送完成之后顺便进入会话仅移动端3.1.10及以上版本支持该字段
news: {
link: location.protocol + '://' + location.host + "/pages/goods_details/index?id=" + item.id, //H5消息页面url 必填
title: item.store_name, //H5消息标题
desc: "", //H5消息摘要
imgUrl: item.image, //H5消息封面图片URL
},
}, function(res) {
if (res.err_msg == 'sendChatMessage:ok') {
console.log('发送成功', res)
//发送成功
} else {
//发送失败
console.log('发送失败', res)
}
})
}else{
jWeixin.invoke('sendChatMessage', {
msgtype: "news", //消息类型,必填
enterChat: true, //为true时表示发送完成之后顺便进入会话仅移动端3.1.10及以上版本支持该字段
news: {
link: location.protocol + '://' + location.host + "/pages/goods_details/index?id=" + item.id, //H5消息页面url 必填
title: item.store_name, //H5消息标题
desc: "", //H5消息摘要
imgUrl: item.image, //H5消息封面图片URL
},
}, function(res) {
if (res.err_msg == 'sendChatMessage:ok') {
console.log('发送成功', res)
//发送成功
} else {
//发送失败
console.log('发送失败', res)
}
})
}
},
switchTab(index) {
if (this.loading) return
if (index === this.active) return;
this.active = index;
this.loadend = false;
this.page = 1;
this.$set(this, 'goodsList', []);
this.getList();
},
search() {
if (this.loading) return
this.loadend = false;
this.page = 1;
this.$set(this, 'goodsList', []);
this.getList();
},
getList() {
let that = this;
let params = {};
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = '加载更多';
params = {
userid: that.userId,
store_name: that.keywords,
page: that.page,
limit: that.limit,
}
if (that.active == 0) {
getWorkCartList(params).then(res => {
let list = res.data || [];
let loadend = list.length < that.limit;
that.goodsList = that.$util.SplitArray(list, that.goodsList);
that.$set(that, 'goodsList', that.goodsList);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page = that.page + 1;
}).catch(err => {
return that.$util.Tips({
title: err
});
})
} else if (that.active == 1) {
getWorkVisitInfo(params).then(res => {
let list = res.data || [];
let loadend = list.length < that.limit;
that.goodsList = that.$util.SplitArray(list, that.goodsList);
that.$set(that, 'goodsList', that.goodsList);
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page = that.page + 1;
}).catch(err => {
return that.$util.Tips({
title: err
});
})
}
}
},
onReachBottom: function() {
this.getList();
}
}
// #endif
</script>
<style lang="scss">
/* #ifdef H5 */
.top_nav {
background: #FFFFFF;
font-size: 28rpx;
// font-family: PingFangSC-Regular, PingFang SC;
// font-weight: 400;
color: #000000;
.navCon{
width: 440rpx;
height: 60rpx;
background: #F4FAFF;
border: 1rpx solid #1A90FE;
border-radius: 30rpx;
margin: 30rpx 0 10rpx 0;
color: #1A90FE;
.text{
width: 50%;
height: 60rpx;
line-height: 60rpx;
text-align: center;
}
.on {
color: #fff;
background-color: #1A90FE;
border-radius: 30rpx 0 0 30rpx;
}
.on2{
color: #fff;
background-color: #1A90FE;
border-radius: 0 30rpx 30rpx 0;
}
}
}
.search {
height: 100rpx;
background: #FFFFFF;
.search_input {
width: 690rpx;
height: 60rpx;
background: #F5F6F9;
border-radius: 34rpx;
padding-left: 20rpx;
}
}
.text_gray {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
text-align: center;
}
.goods_list {
.item {
position: relative;
width: 710rpx;
height: 192rpx;
border-radius: 12rpx;
margin: 20rpx auto 0;
padding: 26rpx 24rpx 26rpx;
box-sizing: border-box;
background: #FFFFFF;
.pushFn {
position: absolute;
bottom: 28rpx;
right: 24rpx;
width: 112rpx;
height: 52rpx;
border-radius: 28rpx;
border: 2rpx solid #1890FF;
font-size: 26rpx;
font-weight: 400;
line-height: 52rpx;
text-align: center;
color: #1890FF;
}
.picture {
width: 140rpx;
height: 140rpx;
border-radius: 8rpx;
image {
width: 100%;
height: 100%;
}
}
.goods_info {
width: 280rpx;
margin-left: 22rpx;
.name {
height: 80rpx;
line-height: 40rpx;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.85);
}
.stork {
font-size: 24rpx;
font-weight: 400;
color: #666666;
}
}
.price_info {
margin-left: 80rpx;
.price {
font-size: 28rpx;
font-weight: 500;
color: #E93323;
}
.send_btn {
width: 112rpx;
height: 52rpx;
display: inline-block;
margin-left: 20rpx;
line-height: 52rpx;
text-align: center;
border-radius: 28rpx;
border: 1px solid #1890FF;
font-size: 26rpx;
font-weight: 400;
color: #1890FF;
}
}
}
}
.empty-box {
height: 600rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 390rpx;
height: 264rpx;
}
}
.ht100 {
height: 120rpx;
}
/* #endif */
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -0,0 +1,280 @@
<template>
<view class="workInfo">
<!-- #ifdef H5 -->
<view class="pad30" v-show="isShow">
<view class='default acea-row row-middle borderRadius15'>
<image :src="userInfo.avatar" mode="aspectFit" class="avatar"></image>
<view class="acea-row row-middle">
<view class="nick_name">{{userInfo.name}}</view>
</view>
</view>
<view class='list acea-row row-middle borderRadius15'>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>手机号</view>
<view class='right_name' v-if="userInfo.userInfo.phone">{{userInfo.userInfo.phone}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>分组</view>
<view class='right_name' v-if="userInfo.userInfo.userGroup">{{userInfo.userInfo.userGroup.group_name}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between'>
<view class='left_name'>用户标签</view>
<view class='label acea-row' v-if="userInfo.userInfo.label && userInfo.userInfo.label.length">
<view class="label_bdg acea-row row-middle row-center"
v-for="(item,index) in userInfo.userInfo.label" :key="index">{{item.label_name}}</view>
</view>
<view class='right_name' v-else>暂无</view>
</view>
</view>
<view class='list acea-row row-middle borderRadius15'>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>会员等级</view>
<view class='right_name' v-if="userInfo.userInfo.level">{{userInfo.userInfo.level}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>推荐人</view>
<view class='right_name' v-if="userInfo.userInfo.spreadUser">{{userInfo.userInfo.spreadUser.nickname}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>用户类型</view>
<view class='right_name' v-if="userInfo.userInfo.user_type">{{userInfo.userInfo.user_type | user_type}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>余额</view>
<view class='right_name' v-if="userInfo.userInfo.now_money">{{userInfo.userInfo.now_money}}</view>
<view class='right_name' v-else>暂无</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>推广员</view>
<view class='right_name'>{{userInfo.userInfo.spread_open ? '是' : '否'}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='left_name'>生日</view>
<view class='right_name' v-if="userInfo.userInfo.birthday">{{userInfo.userInfo.birthday}}</view>
<view class='right_name' v-else>暂无</view>
</view>
</view>
<view style="height: 100px;"></view>
<tNav :active="0"></tNav>
<!-- <view class="tui-fab-box tui-fab-right" @click="groupBack()" v-if="backGroup">
<text class="iconfont icon-fanhui3"></text>
</view> -->
</view>
<!-- #endif -->
</view>
</template>
<script>
// #ifdef H5
import { initWxConfig,initAgentConfig } from "@/libs/work.js";
import {getWorkAgentInfo} from "@/api/work.js";
import tNav from '../components/tabNav.vue';
// import {wx} from "@/utils/agent.js"
export default{
data() {
return {
userId:"",
isShow:false,
userInfo:{
userInfo:{
real_name:"",
level:"",
user_type:"",
now_money:"",
spread_open:"",
birthday:"",
userGroup:{},
label:[],
}
},
backGroup:false
}
},
filters:{
user_type(val){
if(val =='wechat'){
return '公众号'
}else if(val == 'routine'){
return '小程序'
}else if(val == 'h5'){
return 'H5'
}else if(val == 'app'){
return 'APP'
}
}
},
components:{tNav},
onLoad(e) {
this.$Cache.clear('work_user_id')
if(e.userid){
this.userId = e.userid;
this.backGroup = true;
this.$Cache.set('work_user_id',e.userid)
this.getInfo();
}else{
initWxConfig().then((res) => {
this.getUserID();
}).catch((err) => {
return this.$util.Tips({
title: err
});
});
}
// this.getInfo();
},
methods:{
getUserID(){
if (/(iPhone|iPad|iPod|iOS|macintosh|mac os x)/i.test(navigator.userAgent)){
wx.invoke('getContext', {}, (res)=>{
if(res.err_msg == "getContext:ok" && res.entry == "single_chat_tools"){
let entry = res.entry;
//返回进入H5页面的入口类型
//目前有normal、contact_profile、single_chat_tools、group_chat_tools、chat_attachment
wx.invoke('getCurExternalContact', {entry}, (response)=>{
if(response.err_msg == "getCurExternalContact:ok"){
//返回当前外部联系人userId
this.userId = response.userId;
this.$Cache.set('work_user_id',response.userId)
this.getInfo();
}
});
}else if(res.err_msg == "getContext:ok" && res.entry == "group_chat_tools"){
uni.reLaunch({
url:"/pages/work/groupInfo/index"
})
}
});
}else{
jWeixin.invoke('getContext', {}, (res)=>{
if(res.err_msg == "getContext:ok" && res.entry == "single_chat_tools"){
let entry = res.entry ;
//返回进入H5页面的入口类型
//目前有normal、contact_profile、single_chat_tools、group_chat_tools、chat_attachment
jWeixin.invoke('getCurExternalContact', {entry}, (response)=>{
if(response.err_msg == "getCurExternalContact:ok"){
//返回当前外部联系人userId
this.userId = response.userId;
this.$Cache.set('work_user_id',response.userId)
this.getInfo();
}
});
}else if(res.err_msg == "getContext:ok" && res.entry == "group_chat_tools"){
uni.reLaunch({
url:"/pages/work/groupInfo/index"
})
}
});
}
},
getInfo(){
getWorkAgentInfo({
userid:this.userId,
}).then(res=>{
this.isShow = true;
this.userInfo = res.data;
}).catch(err=>{
return this.$util.Tips({
title: err
});
})
},
groupBack(){
uni.navigateTo({
url:"/pages/work/groupInfo/index?back=1"
})
}
}
}
// #endif
</script>
<style lang="scss">
/* #ifdef H5 */
.workInfo{
}
.default {
padding: 0 24rpx;
height: 154rpx;
background-color: #fff;
margin-top: 24rpx;
}
.list {
background-color: #fff;
margin-top: 24rpx;
.item{
width: 100%;
padding: 30rpx;
.left_name{
color: #666666;
font-size: 30rpx;
}
.right_name{
color: #333333;
font-size: 30rpx;
}
.label{
width: 440rpx;
}
.label_bdg{
height: 44rpx;
padding:4rpx 8rpx;
background: rgba(24, 144, 255, 0.1);
border-radius: 2px;
margin-left: 16rpx;
margin-bottom: 16rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #1890FF;
}
}
}
.avatar{
width: 84rpx;
height: 84rpx;
border-radius: 50%;
}
.nick_name{
font-size: 32rpx;
font-weight: 500;
margin: 0 12rpx 0;
color: rgba(0, 0, 0, 0.65);
}
.badge{
width: 56rpx;
height: 28rpx;
background: rgba(100, 64, 194, 0.16);
border-radius: 4rpx;
font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #6440C2;
line-height: 20rpx;
}
.tui-fab-box {
display: flex;
justify-content: center;
flex-direction: column;
position: fixed;
right:40px;
bottom:100px;
z-index: 99997;
width: 64rpx;
height: 64rpx;
background: #FFFFFF;
border-radius: 50%;
box-shadow: 0px 0px 28rpx 0px rgba(0, 0, 0, 0.08);
}
.tui-fab-right {
align-items: flex-end;
}
.iconfont{
font-size: 40rpx;
}
/* #endif */
</style>