From 4710cee80b89d1cd410f8ae7dc41ab8d19b0f95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Tue, 23 Nov 2021 15:51:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 4 +- common/jweixin.js | 82 ++++++++++++++++++++++++ common/queue.js | 4 +- main.js | 1 - node_modules/jweixin-module/README.md | 30 +++++++++ node_modules/jweixin-module/lib/index.js | 1 + node_modules/jweixin-module/package.json | 54 ++++++++++++++++ package-lock.json | 5 ++ pages/index/index.vue | 4 ++ pages/index/tasksdetails.vue | 2 +- pages/my/index.vue | 26 ++++---- pagesB/pages/member/yaoqing.vue | 20 +++--- pagesB/pages/my/my.vue | 8 +-- pagesB/pages/my/setting.vue | 12 +++- pagesB/pages/my/shareFriends.vue | 17 ++++- pagesB/pages/my/teamList.vue | 6 +- 16 files changed, 236 insertions(+), 40 deletions(-) create mode 100644 common/jweixin.js create mode 100644 node_modules/jweixin-module/README.md create mode 100644 node_modules/jweixin-module/lib/index.js create mode 100644 node_modules/jweixin-module/package.json diff --git a/common/config.js b/common/config.js index 46dd8f8..54cdeb7 100644 --- a/common/config.js +++ b/common/config.js @@ -1,6 +1,6 @@ -const ROOTPATH1 = "http://192.168.0.111:8891/sqx_fast"; -// const ROOTPATH1 = "https://fanqie.app.cyjyyjy.com/sqx_fast"; +// const ROOTPATH1 = "http://192.168.0.111:8891/sqx_fast"; +const ROOTPATH1 = "https://fanqie.app.cyjyyjy.com/sqx_fast"; const ROOTPATH = "https://bwc.xianmxkj.com/sqx_fast"; module.exports = { APIHOST: ROOTPATH, diff --git a/common/jweixin.js b/common/jweixin.js new file mode 100644 index 0000000..38158be --- /dev/null +++ b/common/jweixin.js @@ -0,0 +1,82 @@ +var jweixin = require('jweixin-module') +export default { + //判断是否在微信中 + isWechat: function () { + var ua = window.navigator.userAgent.toLowerCase(); + if (ua.match(/micromessenger/i) == 'micromessenger') { + // console.log(‘是微信客户端‘) + return true; + } else { + // console.log(‘不是微信客户端‘) + return false; + } + }, + //初始化sdk配置 + initJssdkShare: function (callback, url) { + uni.request({ + url: 'http://licai.youma.me/index/wechat/', + method: 'GET', + data: { + url: 'http://licaifrot.youma.me/' + }, //这里不是统一的,看你们后端 + success: (res) => { + console.log(res) + if (res.statusCode == 200) { + let result = res.data.Data + console.log(result) + jweixin.config({ + debug: false, + appId: result.appId, + timestamp: result.timestamp, + nonceStr: result.nonceStr, + signature: result.signature, + jsApiList: [ + 'chooseWXPay', + 'checkJsApi', + 'updateTimelineShareData', + 'updateAppMessageShareData' + ] + }); + //配置完成后,再执行分享等功能 + if (callback) { + callback(result); + } + } + } + }); + }, + + //在需要自定义分享的页面中调用 + share: function (data, url) { + url = url ? url : window.location.href; + console.log("url:" + url) + if (!this.isWechat()) { + uni.showToast({ + title: '不在微信客户端', + icon: 'none' + }) + return; + } + //每次都需要重新初始化配置,才可以进行分享 + this.initJssdkShare(function (signData) { + jweixin.ready(function () { + var shareData = { + title: data && data.title ? data.title : signData.site_name, + desc: data && data.desc ? data.desc : signData.site_description, + link: url, + imgUrl: data && data.img ? data.img : signData.site_logo, + success: function (res) { + // 分享后的一些操作,比如分享统计等等 + }, + cancel: function (res) {} + }; + //分享给朋友接口 + jweixin.updateAppMessageShareData(shareData); + //分享到朋友圈接口 + // jweixin.updateTimelineShareData(shareData); + }); + }, url); + }, + + +} diff --git a/common/queue.js b/common/queue.js index bbe968e..c9441f9 100644 --- a/common/queue.js +++ b/common/queue.js @@ -18,11 +18,11 @@ module.exports = { }, //全局域名 部分html中需要单独替换 需要修改config中的网络请求域名 publicYuMing() { - return 'https://bwc.xianmxkj.com' + return 'https://fanqie.app.cyjyyjy.com' }, //全局域名 部分html中需要单独替换 需要修改config中的网络请求域名 publicYuMingAll() { - return 'https://bwc.xianmxkj.com/sqx_fast' + return 'https://fanqie.app.cyjyyjy.com/sqx_fast' }, minMoney() { return uni.getStorageSync("minMoney") ? uni.getStorageSync("minMoney") : '0.3' diff --git a/main.js b/main.js index 6c37723..3e299bc 100644 --- a/main.js +++ b/main.js @@ -25,7 +25,6 @@ Vue.component('tui-no-data', tuinoData); import {VueJsonp} from 'vue-jsonp' Vue.use(VueJsonp) - import 'js_sdk/ican-H5Api/ican-H5Api' import share from './common/share.js' Vue.config.productionTip = false diff --git a/node_modules/jweixin-module/README.md b/node_modules/jweixin-module/README.md new file mode 100644 index 0000000..7c91d7b --- /dev/null +++ b/node_modules/jweixin-module/README.md @@ -0,0 +1,30 @@ +# jweixin-module + +微信JS-SDK + +## 安装 + +### NPM + +```shell +npm install jweixin-module --save +``` + +### UMD + +```http +https://unpkg.com/jweixin-module/out/index.js +``` + +## 使用 + +```js +var jweixin = require('jweixin-module') +jweixin.ready(function(){ + // TODO +}); +``` + +## 完整API + +>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115) diff --git a/node_modules/jweixin-module/lib/index.js b/node_modules/jweixin-module/lib/index.js new file mode 100644 index 0000000..1b5014b --- /dev/null +++ b/node_modules/jweixin-module/lib/index.js @@ -0,0 +1 @@ +!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n - 番茄会员满{{info.memberPrice}}减{{info.memberMoney}}积分,非会员满{{info.price}}减{{info.money}}积分 + 番茄会员满{{info.memberPrice}}返{{info.memberMoney}}积分,非会员满{{info.price}}返{{info.money}}积分 diff --git a/pages/my/index.vue b/pages/my/index.vue index 4c4e344..64e37dc 100644 --- a/pages/my/index.vue +++ b/pages/my/index.vue @@ -84,7 +84,18 @@ - + + + + 我的团队 + 团队成员 {{oneUserCount}}人 + + + 我的订单 + 查看全部订单 + + + @@ -104,19 +115,6 @@ 设置 - - - - 邀请好友 - - diff --git a/pagesB/pages/member/yaoqing.vue b/pagesB/pages/member/yaoqing.vue index 21b1aad..b3ffa91 100644 --- a/pagesB/pages/member/yaoqing.vue +++ b/pagesB/pages/member/yaoqing.vue @@ -39,10 +39,10 @@ {{ item.nickName }} - + {{ item.money ? item.money : '0' }} - {{ item.money ? item.money : '0' }} + {{ item.money ? item.money : '0' }} @@ -72,11 +72,13 @@ state: 'zs', text: '一级', totalElementts: 1 - }, { - state: 'fzs', - text: '二级', - totalElementts: 2 - }], + }, + // { + // state: 'fzs', + // text: '二级', + // totalElementts: 2 + // } + ], }; }, onLoad() { @@ -199,7 +201,7 @@ z-index: 10; color: #FFFFFF; height: 174upx; - background: #ffc705; + background: #FF332F; position: relative; top: -30upx; @@ -237,7 +239,7 @@ // margin-top: 30upx; height: 85upx; color: #FFFFFF; - background: #ffc705; + background: #FF332F; // background-image: url(../../static/img/zysc/yaoqingbtn.png); // background-size: 100%; position: fixed; diff --git a/pagesB/pages/my/my.vue b/pagesB/pages/my/my.vue index 4baedc5..f0525b2 100644 --- a/pagesB/pages/my/my.vue +++ b/pagesB/pages/my/my.vue @@ -221,7 +221,7 @@ // width: 750upx; // height: 320upx; padding-top: 40upx; - background: #ffc705; + background: #FF332F; display: flex; flex-direction: column; justify-content: flex-start; @@ -309,12 +309,12 @@ } .active { - background: #ffc705; + background: #FF332F; width: 36upx; height: 6upx; margin: 0 auto; // margin-top: 10upx; - border-bottom: 6upx solid #ffc705; + border-bottom: 6upx solid #FF332F; position: relative; top: 12upx; } @@ -376,6 +376,6 @@ } .red { - color: #ffc705; + color: #FF332F; } diff --git a/pagesB/pages/my/setting.vue b/pagesB/pages/my/setting.vue index 51d7057..a1ca861 100644 --- a/pagesB/pages/my/setting.vue +++ b/pagesB/pages/my/setting.vue @@ -2,8 +2,11 @@ - - {{item.title}} + + + {{item.title}} + + @@ -96,10 +99,15 @@ height: 72rpx; display: flex; align-items: center; + justify-content: space-between; font-size: 28rpx; color: #000; border-bottom: 2rpx solid #EFEFEF; padding: 0 24rpx; + .item-l{ + display: flex; + align-items: center; + } image{ width: 32rpx; height: 32rpx; diff --git a/pagesB/pages/my/shareFriends.vue b/pagesB/pages/my/shareFriends.vue index df8f507..eb47058 100644 --- a/pagesB/pages/my/shareFriends.vue +++ b/pagesB/pages/my/shareFriends.vue @@ -14,7 +14,9 @@ {{index + 1}} - 、{{item.teamName}}需要邀请{{item.personNum}}人,成为{{item.teamName}}后一级成员每单返{{item.oneMoney}}积分,二级成员每单返{{item.twoMoney}}积分 + + 成为团长需要邀请至少{{item.personNum}}人成为成员,成员成功下单,奖励团长{{item.oneMoney}}积分 + @@ -28,10 +30,18 @@ + + + + + 分享好友 + +