Commit c8efca6987e038b2cebf86d4a47a411316b8ef43

Authored by yvan.ni
1 parent d24dbaf6

拨打电话,和顶部标题

pages/error/error.js
... ... @@ -10,71 +10,22 @@ Page({
10 10 var th=this,app = getApp();
11 11 app.getConfig(function(e){
12 12 th.setData({ store:e,msg:t.msg});
  13 + wx.setNavigationBarTitle({
  14 + title: e.store_name//页面标题
  15 + })
13 16 })
14 17 },
15 18  
16   - getphone: function(e) {
17   - var that = this;
18   - var app=getApp(),a=app;
19   - //此处授权得到userInfo
20   - console.log("getphone");
21   - e=e.detail;
22   - console.log(e);
23   - //接下来写业务代码登录
24   - //最后,记得返回刚才的页面
25   - if (e.encryptedData==undefined){
26   - wx.navigateTo({
27   - url: '/pages/user/binding_info/binding_info',
28   - })
29   - return false;
  19 + phone:function (){
  20 + if(this.data.msg.indexOf("可联系:")!=-1){
  21 + var tel=this.data.msg.split("可联系:")[1];
  22 + if(tel){
  23 + wx.makePhoneCall({
  24 + phoneNumber: tel,
  25 + })
  26 + }
30 27 }
31   - var r=getApp().globalData.getu;
32   - var sessionKey = getApp().globalData.sessionKey;
33   - var openid = getApp().globalData.openid;
34   - var dd = {
35   - oauth: "miniapp",
36   - nickname: r.nickName,
37   - head_pic: r.avatarUrl,
38   - sex: r.gender,
39   - terminal: "miniapp",
40   - sessionKey: sessionKey,
41   - openid:openid,
42   - encryptedData: e.encryptedData,
43   - iv: e.iv,
44   - store_id: a.globalData.setting.stoid,
45   - };
46   - console.log(dd);
  28 + }
47 29  
48   - app.request.get("/api/weshop/users/thirdLogin", {
49   - data: dd,
50   - success: function (e) {
51   - console.log("thirdLogin");
52   - console.log(e);
53   - if (e.data.code == 0) {
54   - app.globalData.user_id = e.data.data.user_id;
55   - } else {
56   - return app.showWarning("授权登入失败!");
57   - }
58   - wx.setStorageSync("isAuth", !0), a.globalData.userInfo = e.data.data, a.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic);
59   - wx.navigateBack({ delta: 1})
60 30  
61   - },
62   - failStatus: function (t) {
63   - return "100" === t.data.result ? (i.goHome(), wx.navigateTo({
64   - url: "/pages/user/binding_info/binding_info?nickName=" + r.nickName + "&userHeadPic=" + r.avatarUrl
65   - }), !1) : (i.clearAuth(), i.alertLoginErrorAndGoHome(t.data.msg), a.request.post("/api/user/logout", {
66   - isShowLoading: !1,
67   - data: {
68   - token: a.request.getToken()
69   - },
70   - failStatus: function () {
71   - return !1;
72   - }
73   - }), !1);
74   - },
75   - fail: function (t) {
76   - return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
77   - }
78   - });
79   - }
80 31 });
... ...
pages/error/error.wxml
... ... @@ -3,6 +3,6 @@
3 3 <view><image class='logo' src="{{imghots+store.store_logo}}"> </image></view>
4 4 <view class="title">{{store.store_name}}</view>
5 5 <view>{{store.store_desc}}</view>
6   - <view class="err">{{msg}}</view>
  6 + <view bindtap="phone" class="err"><text>{{msg}}</text></view>
7 7 </view>
8 8 </view>
9 9 \ No newline at end of file
... ...