Commit 44073581da92c22142d47d503347af999e1e2d9d

Authored by 前端开发-罗建龙
1 parent 86f3ebfe

企业联系我

packageE/pages/qy/contactMe/contactMe.js
... ... @@ -15,9 +15,10 @@ Page({
15 15 phone:'',
16 16 id:"",
17 17 openuserid:'',
  18 + skip_verify:1
18 19 },
19 20 onLoad: function (tt) {
20   - // tt.scene="0_0_1"
  21 + // tt.scene="0_0_13"
21 22 if (tt && tt.scene) {
22 23 var first_leader_str = decodeURIComponent(tt.scene);
23 24 var f_arr = first_leader_str.split("_");
... ... @@ -87,20 +88,69 @@ Page({
87 88  
88 89 getopenuserid(id){
89 90 let url=`/api/weshop/qyWeChat/qywxStaffcode/get/${id}`
90   - console.log(url);
91 91 getApp().request.promiseGet(url,{data:{}}).then(res => {
92 92 console.log(res);
93 93 if (res.data.code == 0) {
94 94 // let resdata=JSON.parse(res.data.data);
95 95 let openuserid=res.data.data.openuserid;
  96 + let skip_verify=res.data.data.skip_verify;
96 97 this.setData({
97   - openuserid
  98 + openuserid,
  99 + skip_verify
98 100 })
99 101 }
100 102 })
101 103 },
102   - getqy(){
103   -
  104 + async getqy(){
  105 + wx.showLoading({
  106 + title: '加载中',
  107 + mask:true
  108 + })
  109 + let openuserid=this.data.openuserid
  110 + let skip_verify=this.data.skip_verify ? true : false
  111 + let res = await getApp().request.promisePost(`/apib/weshop/admin/qyWeChat/qyWeChatCorpInfo/postAdminQyApi?accdb=${this.data.store.erpid}&url=externalcontact/add_contact_way`, {
  112 + data: {
  113 + // accdb: getApp().globalData.config.erpid,
  114 + // ApiName: 'api.pos.shop.advancesum.seek',
  115 + // url:'externalcontact/add_contact_way',
  116 + user:openuserid,
  117 + type:1,
  118 + scene:2,
  119 + style:1,
  120 + state:'手店_'+this.data.phone,
  121 + skip_verify
  122 + // is_temp:true,
  123 + // store_id: getApp().globalData.setting.stoid,
  124 + // usercode: "admin",
  125 + // vipid: this.data.userinfo.erpvipid,
  126 + // oddsum: "0",
  127 + // advancesum: cartList.order_amount,
  128 + // storageid: storageid,
  129 + // listform
  130 + },
  131 + is_json: 1
  132 + })
  133 + wx.hideLoading()
  134 + if(res.data && res.data.errcode==0){
  135 + this.setData({
  136 + qr_code:res.data.qr_code
  137 + })
  138 + }else{
  139 + wx.showModal({
  140 + title: '提示',
  141 + content: '获取二维码失败',
  142 + showCancel:false,
  143 + success (res) {
  144 + if (res.confirm) {
  145 + console.log('用户点击确定')
  146 + } else if (res.cancel) {
  147 + console.log('用户点击取消')
  148 + }
  149 + }
  150 + })
  151 + }
  152 + console.log('获取企业二维码');
  153 + console.log(res);
104 154 },
105 155  
106 156 //绑定手机号
... ... @@ -128,6 +178,7 @@ Page({
128 178 this.setData({
129 179 phone:resdata.phoneNumber
130 180 })
  181 + this.getqy()
131 182 // getApp().globalData.zc_dd = dd;
132 183 // wx.redirectTo({
133 184 // url: "/packageA/pages/profile/profile?is_back=1"
... ...
packageE/pages/qy/contactMe/contactMe.wxml
... ... @@ -60,8 +60,8 @@
60 60 </view>
61 61 <view wx:else class="meBox" >
62 62 <view style="font-weight: bold;margin-bottom: 10rpx;">长按识别二维码</view>
63   - <view style="margin-bottom: 80rpx;">添加我是企业微信</view>
64   - <image style="height: 520rpx;" src="https://wework.qpic.cn/wwpic/283015_6NCVj1q1SuOX-kn_1678947907/0" show-menu-by-longpress ></image>
  63 + <view style="margin-bottom: 80rpx;">添加我的企业微信</view>
  64 + <image style="height: 500rpx;width: 500rpx;" src="{{qr_code}}" show-menu-by-longpress ></image>
65 65 </view>
66 66  
67 67 <!-- <view wx:if="{{show_bind}}">
... ...
packageE/pages/qy/contactMe/contactMe.wxss
... ... @@ -79,7 +79,7 @@ checkbox .wx-checkbox-input {
79 79 .meBox{
80 80 color: rgb(127, 128, 132);
81 81 font-size: 50rpx;
82   - height: 100vh;
  82 + height: 80vh;
83 83 display: flex;
84 84 align-items: center;
85 85 flex-direction: column;
... ...