feat: 增加-个人小程序客服

This commit is contained in:
huxiaoshuang
2022-11-25 11:18:27 +08:00
parent bd9b87f6da
commit 874e128b49
6 changed files with 74 additions and 53 deletions

32
dist/base.wxml vendored
View File

@@ -65,14 +65,6 @@
</button>
</template>
<template name="tmpl_0_21">
<form report-submit="{{xs.b(i.p1,!1)}}" bindsubmit="eh" bindreset="eh" name="{{i.p0}}" report-submit-timeout="{{xs.b(i.p2,0)}}" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</form>
</template>
<template name="tmpl_0_24">
<template is="{{xs.c(i, 'tmpl_0_')}}" data="{{i:i}}" />
</template>
@@ -185,14 +177,6 @@
</text>
</template>
<template name="tmpl_1_21">
<form report-submit="{{xs.b(i.p1,!1)}}" bindsubmit="eh" bindreset="eh" name="{{i.p0}}" report-submit-timeout="{{xs.b(i.p2,0)}}" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</form>
</template>
<template name="tmpl_1_48">
<scroll-view scroll-x="{{xs.b(i.p18,!1)}}" scroll-y="{{xs.b(i.p19,!1)}}" upper-threshold="{{xs.b(i.p21,50)}}" lower-threshold="{{xs.b(i.p6,50)}}" scroll-top="{{i.p16}}" scroll-left="{{i.p15}}" scroll-into-view="{{i.p14}}" scroll-with-animation="{{xs.b(i.p17,!1)}}" enable-back-to-top="{{xs.b(i.p2,!1)}}" bindscrolltoupper="eh" bindscrolltolower="eh" bindscroll="eh" bindtouchstart="eh" bindtouchmove="eh" bindtouchend="eh" bindtouchcancel="eh" bindlongpress="eh" animation="{{i.p0}}" bindanimationstart="eh" bindanimationiteration="eh" bindanimationend="eh" bindtransitionend="eh" enable-flex="{{xs.b(i.p3,false)}}" scroll-anchoring="{{xs.b(i.p13,false)}}" refresher-enabled="{{xs.b(i.p10,false)}}" refresher-threshold="{{xs.b(i.p11,45)}}" refresher-default-style="{{xs.b(i.p9,'black')}}" refresher-background="{{xs.b(i.p8,'#FFF')}}" refresher-triggered="{{xs.b(i.p12,false)}}" enhanced="{{xs.b(i.p4,false)}}" bounces="{{xs.b(i.p1,true)}}" show-scrollbar="{{xs.b(i.p20,true)}}" paging-enabled="{{xs.b(i.p7,false)}}" fast-deceleration="{{xs.b(i.p5,false)}}" binddragstart="eh" binddragging="eh" binddragend="eh" bindrefresherpulling="eh" bindrefresherrefresh="eh" bindrefresherrestore="eh" bindrefresherabort="eh" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
@@ -253,14 +237,6 @@
</text>
</template>
<template name="tmpl_2_21">
<form report-submit="{{xs.b(i.p1,!1)}}" bindsubmit="eh" bindreset="eh" name="{{i.p0}}" report-submit-timeout="{{xs.b(i.p2,0)}}" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</form>
</template>
<template name="tmpl_2_48">
<scroll-view scroll-x="{{xs.b(i.p18,!1)}}" scroll-y="{{xs.b(i.p19,!1)}}" upper-threshold="{{xs.b(i.p21,50)}}" lower-threshold="{{xs.b(i.p6,50)}}" scroll-top="{{i.p16}}" scroll-left="{{i.p15}}" scroll-into-view="{{i.p14}}" scroll-with-animation="{{xs.b(i.p17,!1)}}" enable-back-to-top="{{xs.b(i.p2,!1)}}" bindscrolltoupper="eh" bindscrolltolower="eh" bindscroll="eh" bindtouchstart="eh" bindtouchmove="eh" bindtouchend="eh" bindtouchcancel="eh" bindlongpress="eh" animation="{{i.p0}}" bindanimationstart="eh" bindanimationiteration="eh" bindanimationend="eh" bindtransitionend="eh" enable-flex="{{xs.b(i.p3,false)}}" scroll-anchoring="{{xs.b(i.p13,false)}}" refresher-enabled="{{xs.b(i.p10,false)}}" refresher-threshold="{{xs.b(i.p11,45)}}" refresher-default-style="{{xs.b(i.p9,'black')}}" refresher-background="{{xs.b(i.p8,'#FFF')}}" refresher-triggered="{{xs.b(i.p12,false)}}" enhanced="{{xs.b(i.p4,false)}}" bounces="{{xs.b(i.p1,true)}}" show-scrollbar="{{xs.b(i.p20,true)}}" paging-enabled="{{xs.b(i.p7,false)}}" fast-deceleration="{{xs.b(i.p5,false)}}" binddragstart="eh" binddragging="eh" binddragend="eh" bindrefresherpulling="eh" bindrefresherrefresh="eh" bindrefresherrestore="eh" bindrefresherabort="eh" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
@@ -321,14 +297,6 @@
</text>
</template>
<template name="tmpl_3_21">
<form report-submit="{{xs.b(i.p1,!1)}}" bindsubmit="eh" bindreset="eh" name="{{i.p0}}" report-submit-timeout="{{xs.b(i.p2,0)}}" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">
<template is="{{xs.e(cid+1)}}" data="{{i:item,l:l}}" />
</block>
</form>
</template>
<template name="tmpl_3_48">
<scroll-view scroll-x="{{xs.b(i.p18,!1)}}" scroll-y="{{xs.b(i.p19,!1)}}" upper-threshold="{{xs.b(i.p21,50)}}" lower-threshold="{{xs.b(i.p6,50)}}" scroll-top="{{i.p16}}" scroll-left="{{i.p15}}" scroll-into-view="{{i.p14}}" scroll-with-animation="{{xs.b(i.p17,!1)}}" enable-back-to-top="{{xs.b(i.p2,!1)}}" bindscrolltoupper="eh" bindscrolltolower="eh" bindscroll="eh" bindtouchstart="eh" bindtouchmove="eh" bindtouchend="eh" bindtouchcancel="eh" bindlongpress="eh" animation="{{i.p0}}" bindanimationstart="eh" bindanimationiteration="eh" bindanimationend="eh" bindtransitionend="eh" enable-flex="{{xs.b(i.p3,false)}}" scroll-anchoring="{{xs.b(i.p13,false)}}" refresher-enabled="{{xs.b(i.p10,false)}}" refresher-threshold="{{xs.b(i.p11,45)}}" refresher-default-style="{{xs.b(i.p9,'black')}}" refresher-background="{{xs.b(i.p8,'#FFF')}}" refresher-triggered="{{xs.b(i.p12,false)}}" enhanced="{{xs.b(i.p4,false)}}" bounces="{{xs.b(i.p1,true)}}" show-scrollbar="{{xs.b(i.p20,true)}}" paging-enabled="{{xs.b(i.p7,false)}}" fast-deceleration="{{xs.b(i.p5,false)}}" binddragstart="eh" binddragging="eh" binddragend="eh" bindrefresherpulling="eh" bindrefresherrefresh="eh" bindrefresherrestore="eh" bindrefresherabort="eh" style="{{i.st}}" class="{{i.cl}}" bindtap="eh" id="{{i.uid||i.sid}}" data-sid="{{i.sid}}">
<block wx:for="{{i.cn}}" wx:key="sid">

View File

@@ -1,2 +1,2 @@
/*! For license information please see index.js.LICENSE.txt */
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,o){var t=o("./node_modules/@antmjs/vantui/es/cell/index.js"),a=o("./node_modules/@antmjs/vantui/es/toast/index.js"),s=o("./node_modules/@antmjs/vantui/es/button/index.js"),l=o("./node_modules/@antmjs/vantui/es/image/index.js"),u=o("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),i=o("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),d=o("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),c=o("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),r=o("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),m=o("webpack/container/remote/react"),f=o("./src/pages/components/TabbarCom/index.tsx"),p=o("webpack/container/remote/@tarojs/taro"),x=o.n(p),g=(o("./src/pages/components/ActiveCard/index.tsx"),o("./src/utils/index.ts")),v=o("./config.js"),j=o("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,m.useState)({}),o=(0,c.default)(n,2),p=(o[0],o[1],(0,m.useState)([])),b=(0,c.default)(p,2),h=(b[0],b[1],(0,m.useState)(0)),k=(0,c.default)(h,2),w=(k[0],k[1],(0,m.useState)(!0)),y=(0,c.default)(w,2),_=y[0],C=y[1];(0,m.useEffect)((function(){N()}),[]);var N=function(){var e=(0,d.default)((0,i.default)().mark((function _callee(){var e;return(0,i.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,g.phoneLogin)();case 2:e=n.sent,console.log("isok",e),C(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,m.useEffect)((function(){}),[]);var I=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){x().cloud.callFunction({name:"getPhoneNum",data:{weRunData:x().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,o,t,a,s,l,i,d,c;console.log("res222",e);var r=null==e||null===(n=e.result)||void 0===n||null===(o=n.event)||void 0===o||null===(t=o.weRunData)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(l=s.context)||void 0===l?void 0:l.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(i=e.result)||void 0===i||null===(d=i.event)||void 0===d||null===(c=d.userInfo)||void 0===c?void 0:c.openId},okFun:function okFun(e){var n,o;console.log("q",e),(0,g.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(o=n[0])||void 0===o?void 0:o._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:r}},okFun:function okFun(e){N()}})}};(0,g.getTable)((0,u.default)({},f))}))}(e)};return(0,j.jsxs)(r.View,{className:"myContent",children:[(0,j.jsxs)(r.View,{className:"myImage",children:[(0,j.jsx)(l.default,{round:!0,width:"100px",height:"100px",src:"cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images/images-2.jpg"}),!_&&(0,j.jsx)(r.View,{className:"loginBtn",children:(0,j.jsx)(s.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),I(e)},children:"登录"})})]}),(0,j.jsxs)(r.View,{className:"cellArr",children:["people"!==v.type&&(0,j.jsx)(t.default,{icon:"manager",title:"打卡记录",isLink:!0,onClick:function onClick(){_?x().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):a.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),"people"!==v.type&&(0,j.jsx)(t.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){x().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}}),(0,j.jsx)(t.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){x().navigateTo({url:"/pages/my/components/AbountUs/index"})}})]}),(0,j.jsx)(a.default,{id:"vanToast-demo2"}),(0,j.jsx)(f.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,o){var t=o("webpack/container/remote/@tarojs/runtime"),a=o("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx");Page((0,t.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]);
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/my/index"],{"./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx":function(e,n,t){var o=t("./node_modules/@antmjs/vantui/es/icon/index.js"),a=t("./node_modules/@antmjs/vantui/es/cell/index.js"),s=t("./node_modules/@antmjs/vantui/es/toast/index.js"),l=t("./node_modules/@antmjs/vantui/es/button/index.js"),i=t("./node_modules/@antmjs/vantui/es/image/index.js"),u=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),c=t("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),d=t("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),r=t("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),m=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),f=t("webpack/container/remote/react"),p=t("./src/pages/components/TabbarCom/index.tsx"),x=t("webpack/container/remote/@tarojs/taro"),v=t.n(x),g=(t("./src/pages/components/ActiveCard/index.tsx"),t("./src/utils/index.ts")),j=t("./config.js"),b=t("webpack/container/remote/react/jsx-runtime");n.default=function my(e){var n=(0,f.useState)({}),t=(0,r.default)(n,2),x=(t[0],t[1],(0,f.useState)([])),h=(0,r.default)(x,2),w=(h[0],h[1],(0,f.useState)(0)),k=(0,r.default)(w,2),y=(k[0],k[1],(0,f.useState)(!0)),_=(0,r.default)(y,2),N=_[0],C=_[1];(0,f.useEffect)((function(){I()}),[]);var I=function(){var e=(0,d.default)((0,c.default)().mark((function _callee(){var e;return(0,c.default)().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,g.phoneLogin)();case 2:e=n.sent,console.log("isok",e),C(e);case 5:case"end":return n.stop()}}),_callee)})));return function getok(){return e.apply(this,arguments)}}();(0,f.useEffect)((function(){}),[]);var T=function getPhoneNumber(e){console.log("点击获取手机事件",e.detail.cloudID),function getLogin(e){v().cloud.callFunction({name:"getPhoneNum",data:{weRunData:v().cloud.CloudID(e.detail.cloudID)}}).then((function(e){var n,t,o,a,s,l,i,c,d;console.log("res222",e);var r=null==e||null===(n=e.result)||void 0===n||null===(t=n.event)||void 0===t||null===(o=t.weRunData)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.phoneNumber,m=null==e||null===(s=e.result)||void 0===s||null===(l=s.context)||void 0===l?void 0:l.tencentcloud_uin,f={tableName:"userInfo",keyValue:{openId:null==e||null===(i=e.result)||void 0===i||null===(c=i.event)||void 0===c||null===(d=c.userInfo)||void 0===d?void 0:d.openId},okFun:function okFun(e){var n,t;console.log("q",e),(0,g.updateTableid)({id:null==e||null===(n=e.data)||void 0===n||null===(t=n[0])||void 0===t?void 0:t._id,tableName:"userInfo",objData:{tencentcloud_uin:m,authInfo:{authPhonenum:r}},okFun:function okFun(e){I()}})}};(0,g.getTable)((0,u.default)({},f))}))}(e)};return(0,b.jsxs)(m.View,{className:"myContent",children:[(0,b.jsxs)(m.View,{className:"myImage",children:[(0,b.jsx)(i.default,{round:!0,width:"100px",height:"100px",src:"cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/download-1.jpg"}),!N&&(0,b.jsx)(m.View,{className:"loginBtn",children:(0,b.jsx)(l.default,{type:"primary",size:"mini","open-type":"getPhoneNumber",lang:"zh_CN",onGetPhoneNumber:function onGetPhoneNumber(e){console.log("info",e),T(e)},children:"登录"})})]}),(0,b.jsxs)(m.View,{className:"cellArr",children:["people"!==j.type&&(0,b.jsx)(a.default,{icon:"manager",title:"打卡记录",isLink:!0,onClick:function onClick(){N?v().navigateTo({url:"/pages/my/components/CheckinDetail/index"}):s.default.fail({message:"请先登录",selector:"#vanToast-demo2"})}}),(0,b.jsxs)(m.View,{className:"wechat",children:[(0,b.jsx)(o.default,{name:"wechat",size:"16px",className:"icon"}),(0,b.jsx)(l.default,{"open-type":"contact",className:"wecahtBtn",children:"微信客服"})]}),"people"!==j.type&&(0,b.jsx)(a.default,{title:"微信客服",icon:"wechat",isLink:!0,value:"",onClick:function onClick(){v().openCustomerServiceChat({corpId:"wwb04af9a97514271c",extInfo:{url:"https://work.weixin.qq.com/kfid/kfc70f3f112c97a54c5"},success:function success(e){}})}}),(0,b.jsx)(a.default,{icon:"friends",title:"关于我们",isLink:!0,onClick:function onClick(){v().navigateTo({url:"/pages/my/components/AbountUs/index"})}})]}),(0,b.jsx)(s.default,{id:"vanToast-demo2"}),(0,b.jsx)(p.default,{active:2})]})}},"./src/pages/my/index.tsx":function(e,n,t){var o=t("webpack/container/remote/@tarojs/runtime"),a=t("./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[9].use[1]!./src/pages/my/index.tsx");Page((0,o.createPageConfig)(a.default,"pages/my/index",{root:{cn:[]}},{navigationBarTitleText:"我的"}||{}))}},function(e){e.O(0,["taro","vendors","common"],(function(){return n="./src/pages/my/index.tsx",e(e.s=n);var n}));e.O()}]);

View File

@@ -20,6 +20,8 @@
/*! @antmjs/vantui/es/cell */
/*! @antmjs/vantui/es/icon */
/*! @antmjs/vantui/es/image */
/*! @antmjs/vantui/es/toast */

View File

@@ -32,3 +32,26 @@
.cellArr {
margin-top: 20rpx;
}
.wechat {
padding-left: 35rpx;
padding-right: 35rpx;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.wechat .wecahtBtn {
width: 100%;
}
.wechat .wecahtBtn .van-button__text {
position: relative;
left: -245rpx;
}

View File

@@ -20,4 +20,22 @@
.cellArr{
margin-top: 20px;
}
.wechat{
padding-left: 35px;
padding-right: 35px;
// background-color: yellow;
display: flex ;
flex-direction: row;
align-items: center;
// justify-content: center;
.wecahtBtn{
width: 100%;
// background-color: aqua;
.van-button__text{
position: relative;
left: -245px;
}
}
}

View File

@@ -3,12 +3,13 @@ import {
Card,
Cell,
Col,
Icon,
Row,
Tabbar,
TabbarItem,
Toast,
} from "@antmjs/vantui";
import { OpenData, View } from "@tarojs/components";
import { OpenData, View ,Text} from "@tarojs/components";
import react, { useEffect, useState } from "react";
import TabbarCom from "../components/TabbarCom";
import { Image } from "@antmjs/vantui";
@@ -163,7 +164,7 @@ const my = (props: any) => {
round
width="100px"
height="100px"
src="cloud://cloud1-5g5xrgza12a0dd6d.636c-cloud1-5g5xrgza12a0dd6d-1253665791/images/images-2.jpg"
src="cloud://citynew-0givkbre03955d8c.6369-citynew-0givkbre03955d8c-1253655588/images/touxiang/download-1.jpg"
/>
{!isin && (
@@ -203,26 +204,35 @@ const my = (props: any) => {
</View> */}
<View className="cellArr">
{type !== "people" && <Cell
icon="manager"
title="打卡记录"
isLink
onClick={() => {
if (isin) {
// 跳转到目的页面,打开新页面
Taro.navigateTo({
url: "/pages/my/components/CheckinDetail/index",
});
} else {
Toast.fail({
message: "请先登录",
selector: "#vanToast-demo2",
});
}
}}
/>}
{type !== "people" && (
<Cell
icon="manager"
title="打卡记录"
isLink
onClick={() => {
if (isin) {
// 跳转到目的页面,打开新页面
Taro.navigateTo({
url: "/pages/my/components/CheckinDetail/index",
});
} else {
Toast.fail({
message: "请先登录",
selector: "#vanToast-demo2",
});
}
}}
/>
)}
{/* <Cell icon="manager" title="个人资料" isLink /> */}
{/* 个人客服 */}
<View className="wechat">
<Icon name="wechat" size="16px" className="icon"></Icon>
{/* <Text>微信客服</Text> */}
<Button open-type="contact" className="wecahtBtn"></Button>
</View>
{type !== "people" && (
<Cell
title="微信客服"