diff --git a/src/composables/useGlobalFunc.ts b/src/composables/useGlobalFunc.ts index e6e41cf..9df4ed5 100644 --- a/src/composables/useGlobalFunc.ts +++ b/src/composables/useGlobalFunc.ts @@ -144,80 +144,80 @@ function useGlobalFunc() { success?: Function } function appWxLogin(options: appWxLoginType) { - uni.getProvider({ - service: 'share', - success: function (res) { - // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 - if(res.provider[0] == 'weixin'){ - // 微信开放平台的应用标识 - // 预登录 - let weixinService: AnyObject - plus.oauth.getServices((services) => { - if (services && services.length) { - for (var i = 0, len = services.length; i < len; i++) { - if (services[i].id === 'weixin') { - weixinService = services[i] - break - } - } - // 如果没有获取到微信服务,则退出授权 - if (!weixinService) { - return uni.jxAlert({ - title: '登录失败', - content: '请先下载微信', - }) - } + // uni.getProvider({ + // service: 'share', + // success: function (res) { + // // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 + // if(res.provider[0] == 'weixin'){ + // // 微信开放平台的应用标识 + // // 预登录 + // let weixinService: AnyObject + // plus.oauth.getServices((services) => { + // if (services && services.length) { + // for (var i = 0, len = services.length; i < len; i++) { + // if (services[i].id === 'weixin') { + // weixinService = services[i] + // break + // } + // } + // // 如果没有获取到微信服务,则退出授权 + // if (!weixinService) { + // return uni.jxAlert({ + // title: '登录失败', + // content: '请先下载微信', + // }) + // } - // 进行微信授权,拿到 code - weixinService.authorize(async (event: AnyObject) => { - //此处获取code的关键 - let data = { - authType: "weixinapp", - authSecret: event.code, - } - // event.code 发给后端验证,验证成功后处理业务 - let res = await login.applets_login(data) - console.log('ZSW-res', res); - if (res.code == 0) { - // 第一次登录绑定手机号码 - if (res.data.tokenType == 2) { - options.bangding && options.bangding(res.data.token) - } + // // 进行微信授权,拿到 code + // weixinService.authorize(async (event: AnyObject) => { + // //此处获取code的关键 + // let data = { + // authType: "weixinapp", + // authSecret: event.code, + // } + // // event.code 发给后端验证,验证成功后处理业务 + // let res = await login.applets_login(data) + // console.log('ZSW-res', res); + // if (res.code == 0) { + // // 第一次登录绑定手机号码 + // if (res.data.tokenType == 2) { + // options.bangding && options.bangding(res.data.token) + // } - // 登录成功 - if (res.data.tokenType != 2) { - options.success && options.success(res.data) - } - } else { - if ((res.desc).indexOf('row') == -1) { - uni.jxAlert({ - title: '提示', - content: `登录失败:${res.desc || res.data}` - }) - } else { - uni.jxAlert({ - title: '提示', - content: `登录失败:对不起该账号未绑定门店,请联系官方客服进行绑定!` - }) - } + // // 登录成功 + // if (res.data.tokenType != 2) { + // options.success && options.success(res.data) + // } + // } else { + // if ((res.desc).indexOf('row') == -1) { + // uni.jxAlert({ + // title: '提示', + // content: `登录失败:${res.desc || res.data}` + // }) + // } else { + // uni.jxAlert({ + // title: '提示', + // content: `登录失败:对不起该账号未绑定门店,请联系官方客服进行绑定!` + // }) + // } - } - }) - } else { - uni.jxAlert({ - title: '提示', - content: '本机不支持微信登录', - }) - } - }) - }else{ - uni.jxAlert({ - title: '提示', - content: '请先下载微信', - }) - } - } - }) + // } + // }) + // } else { + // uni.jxAlert({ + // title: '提示', + // content: '本机不支持微信登录', + // }) + // } + // }) + // }else{ + // uni.jxAlert({ + // title: '提示', + // content: '请先下载微信', + // }) + // } + // } + // }) // if (plus.runtime.isApplicationExist({ pname: 'com.tencent.mm', action: 'weixin://' })) { // 判断用户是否安装了微信 // // 微信开放平台的应用标识 @@ -375,42 +375,42 @@ function useGlobalFunc() { * @param {string} [id] 小程序原始ID */ function openWeixin(url: string, id = 'gh_e9161397303e') { - uni.getProvider({ - service: 'share', - success: function (res) { - // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 - // isInstallWx.value = res.provider[0] == 'weixin' ? true : false - if(res.provider[0] == 'weixin'){ - // 跳转到微信小程序进行物料申请 - plus.share.getServices(function (res) { - var sweixin = null; - for (var i = 0; i < res.length; i++) { - var t: AnyObject = res[i]; - if (t.id == 'weixin') { - sweixin = t; - } - } - if (sweixin) { - sweixin.launchMiniProgram({ - id: id, //这里写你的小程序原始id(以gh开头) - type: 0, //这里是不同的环境( 0-正式版; 1-测试版; 2-体验版。 默认值为0。) - path: url, //这里是指 定页的路径,如需传参直接字符串拼接(首页可以省略) - }); - } - }, function (res) { - uni.jxAlert({ - title: '提示', - content: '打开小程序失败', - }) - }); - }else{ - uni.jxAlert({ - title: '温馨提示', - content: '请先下载微信', - }) - } - } - }) + // uni.getProvider({ + // service: 'share', + // success: function (res) { + // // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 + // // isInstallWx.value = res.provider[0] == 'weixin' ? true : false + // if(res.provider[0] == 'weixin'){ + // // 跳转到微信小程序进行物料申请 + // plus.share.getServices(function (res) { + // var sweixin = null; + // for (var i = 0; i < res.length; i++) { + // var t: AnyObject = res[i]; + // if (t.id == 'weixin') { + // sweixin = t; + // } + // } + // if (sweixin) { + // sweixin.launchMiniProgram({ + // id: id, //这里写你的小程序原始id(以gh开头) + // type: 0, //这里是不同的环境( 0-正式版; 1-测试版; 2-体验版。 默认值为0。) + // path: url, //这里是指 定页的路径,如需传参直接字符串拼接(首页可以省略) + // }); + // } + // }, function (res) { + // uni.jxAlert({ + // title: '提示', + // content: '打开小程序失败', + // }) + // }); + // }else{ + // uni.jxAlert({ + // title: '温馨提示', + // content: '请先下载微信', + // }) + // } + // } + // }) // if (plus.runtime.isApplicationExist({ pname: 'com.tencent.mm', action: 'weixin://' })) { // 判断用户是否安装了微信 // // 跳转到微信小程序进行物料申请 // plus.share.getServices(function (res) { diff --git a/src/pages.json b/src/pages.json index 9bd40b2..b6d1ade 100644 --- a/src/pages.json +++ b/src/pages.json @@ -239,17 +239,17 @@ "navigationBarTitleText": "扫码进店" } }, - { - "path": "enterGroupChat/enterGroupChat", - "style": { - "navigationBarTitleText": "进入群聊", - "mp-weixin": { - "usingComponents": { - "cell": "plugin://chatGroupPlugin/cell" - } - } - } - }, + // { + // "path": "enterGroupChat/enterGroupChat", + // "style": { + // "navigationBarTitleText": "进入群聊", + // "mp-weixin": { + // "usingComponents": { + // "cell": "plugin://chatGroupPlugin/cell" + // } + // } + // } + // }, { "path": "message/message", "style": { @@ -274,12 +274,12 @@ "navigationBarTitleText": "设置" } }, - { - "path": "printerSetUp/printerSetUp", - "style": { - "navigationBarTitleText": "蓝牙打印机设置" - } - }, + // { + // "path": "printerSetUp/printerSetUp", + // "style": { + // "navigationBarTitleText": "蓝牙打印机设置" + // } + // }, { "path": "businessLicense/businessLicense", "style": { diff --git a/src/pages/merchant/options/options.ts b/src/pages/merchant/options/options.ts index c168c4d..a34869f 100644 --- a/src/pages/merchant/options/options.ts +++ b/src/pages/merchant/options/options.ts @@ -18,9 +18,9 @@ function options() { /** * 进入群聊 */ - function getGroupChat() { - openWeixin('subPages/merchantChild/enterGroupChat/enterGroupChat') - } + // function getGroupChat() { + // openWeixin('subPages/merchantChild/enterGroupChat/enterGroupChat') + // } /** * 注册时间 @@ -38,48 +38,49 @@ function options() { } - /** - * 物料申请 - */ - function moveToWM() { - let tel = store.state.storeInfo.allStoreInfo.marketManPhone ? store.state.storeInfo.allStoreInfo.marketManPhone : "18048531223" - if (getStorage('terrace') != 'jxcs') { - // 果园禁止物料跳转 - uni.jxAlert({ - title: '物料申请', - content: `非常抱歉,无法进入物料商城,请联系运营${tel}` - }) - return - } else { - if (store.state.storeInfo.allStoreInfo.packageSwitch === 1) { - uni.jxAlert({ - title: '物料申请', - content: `非常抱歉,无法进入物料商城,请联系运营${tel}` - }) - return - } - } + // /** + // * 物料申请 + // */ + // function moveToWM() { + // let tel = store.state.storeInfo.allStoreInfo.marketManPhone ? store.state.storeInfo.allStoreInfo.marketManPhone : "18048531223" + // if (getStorage('terrace') != 'jxcs') { + // // 果园禁止物料跳转 + // uni.jxAlert({ + // title: '物料申请', + // content: `非常抱歉,无法进入物料商城,请联系运营${tel}` + // }) + // return + // } else { + // if (store.state.storeInfo.allStoreInfo.packageSwitch === 1) { + // uni.jxAlert({ + // title: '物料申请', + // content: `非常抱歉,无法进入物料商城,请联系运营${tel}` + // }) + // return + // } + // } - if (store.state.storeInfo.storeStatus === -2) { - uni.jxAlert({ - title: '物料申请', - content: '门店已被禁用,请联系运营' - }) - } - openWeixin(`pages/index/index?storeID=666666&fromStoreID=${getStorage('storeID')}&storeType=c4`, 'gh_0d7e2243b51f') - } + // if (store.state.storeInfo.storeStatus === -2) { + // uni.jxAlert({ + // title: '物料申请', + // content: '门店已被禁用,请联系运营' + // }) + // } + // openWeixin(`pages/index/index?storeID=666666&fromStoreID=${getStorage('storeID')}&storeType=c4`, 'gh_0d7e2243b51f') + // } /** * 查询是否有新账单 */ const isInstallWx = ref(false) // 是否安装微信 onLoad(async () => { - uni.getProvider({ - service: 'share', - success: function (res) { - // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 - isInstallWx.value = res.provider[0] == 'weixin' ? true : false - }}) + + // uni.getProvider({ + // service: 'share', + // success: function (res) { + // // res.provider[0] === 'weixin' ? 微信已经安装 : 微信尚未安装 + // isInstallWx.value = res.provider[0] == 'weixin' ? true : false + // }}) // if (plus.runtime.isApplicationExist({ pname: 'com.tencent.mm', action: 'weixin://' })) { // isInstallWx.value = true // } else { @@ -261,9 +262,9 @@ function options() { return { - getGroupChat, // 跳转加入群聊 + // getGroupChat, // 跳转加入群聊 getSelfInfo, // 获取门店来京西的时间 - moveToWM, // 物料申请 + // moveToWM, // 物料申请 newBillShow, // 是否有新账单 billList, // 账单列表 msgCount, // 是否有信息 diff --git a/src/pages/merchant/options/options.vue b/src/pages/merchant/options/options.vue index afa73a6..20ca0f2 100644 --- a/src/pages/merchant/options/options.vue +++ b/src/pages/merchant/options/options.vue @@ -99,12 +99,13 @@