Browse Source

提交代码

yh
杨豪 3 years ago
parent
commit
4710cee80b
  1. 4
      common/config.js
  2. 82
      common/jweixin.js
  3. 4
      common/queue.js
  4. 1
      main.js
  5. 30
      node_modules/jweixin-module/README.md
  6. 1
      node_modules/jweixin-module/lib/index.js
  7. 54
      node_modules/jweixin-module/package.json
  8. 5
      package-lock.json
  9. 4
      pages/index/index.vue
  10. 2
      pages/index/tasksdetails.vue
  11. 24
      pages/my/index.vue
  12. 20
      pagesB/pages/member/yaoqing.vue
  13. 8
      pagesB/pages/my/my.vue
  14. 8
      pagesB/pages/my/setting.vue
  15. 15
      pagesB/pages/my/shareFriends.vue
  16. 6
      pagesB/pages/my/teamList.vue

4
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,

82
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);
},
}

4
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'

1
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

30
node_modules/jweixin-module/README.md generated vendored

@ -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)

1
node_modules/jweixin-module/lib/index.js generated vendored

File diff suppressed because one or more lines are too long

54
node_modules/jweixin-module/package.json generated vendored

@ -0,0 +1,54 @@
{
"_from": "jweixin-module",
"_id": "jweixin-module@1.6.0",
"_inBundle": false,
"_integrity": "sha1-Sn6mFAg+PJw/SeL9wruILPpY380=",
"_location": "/jweixin-module",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "jweixin-module",
"name": "jweixin-module",
"escapedName": "jweixin-module",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.nlark.com/jweixin-module/download/jweixin-module-1.6.0.tgz",
"_shasum": "4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd",
"_spec": "jweixin-module",
"_where": "F:\\sqx-bawangcan用户端小程序\\sqx-bawangcan",
"author": {
"name": "Shengqiang Guo"
},
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "微信JS-SDK",
"devDependencies": {},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"license": "ISC",
"main": "lib/index.js",
"name": "jweixin-module",
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"scripts": {},
"version": "1.6.0"
}

5
package-lock.json generated

@ -2,6 +2,11 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.nlark.com/jweixin-module/download/jweixin-module-1.6.0.tgz",
"integrity": "sha1-Sn6mFAg+PJw/SeL9wruILPpY380="
},
"vue-jsonp": {
"version": "2.0.0",
"resolved": "https://registry.nlark.com/vue-jsonp/download/vue-jsonp-2.0.0.tgz",

4
pages/index/index.vue

@ -156,12 +156,15 @@
onLoad(e) {
let that = this;
if (e.userByinvitationId) {
console.log(e.userByinvitationId,'userByinvitationId')
this.$queue.setData('userByinvitationId', e.userByinvitationId);
}
// #ifdef MP-WEIXIN
if (e.scene) {
console.log(e.scene,'scene')
const scene = decodeURIComponent(e.scene);
console.log(scene,'scenescene')
this.$queue.setData('userByinvitationId', scene.split(',')[0]);
}
// #endif
@ -235,6 +238,7 @@
this.getHaoDianTuiJian1();
},
onShow() {
let that = this;
var city = this.$queue.getData('city');
var localCampus = this.$queue.getData('localCampus');

2
pages/index/tasksdetails.vue

@ -52,7 +52,7 @@
</view>
<view class="line"></view>
<view class="bottom">
<view class="text"> 番茄会员满{{info.memberPrice}}{{info.memberMoney}}积分,非会员满{{info.price}}{{info.money}}积分 </view>
<view class="text"> 番茄会员满{{info.memberPrice}}{{info.memberMoney}}积分,非会员满{{info.price}}{{info.money}}积分 </view>
</view>
</view>

24
pages/my/index.vue

@ -85,6 +85,17 @@
</view>
</view>
<view class="fxandfl_view">
<view class="fx_view" @tap="goPageLogin('/pagesB/pages/my/teamList')">
<view class="title">我的团队</view>
<view class="btn" @tap="goShareUser">团队成员 <text style="color: #FF332F;">{{oneUserCount}}</text> </view>
</view>
<view class="fx_view" style="margin-left: 20rpx;" @tap="goPageLoginS('/pages/order/index')">
<view class="title">我的订单</view>
<view class="btn" @tap="goShareUser">查看全部订单</view>
</view>
</view>
</view>
<view style="margin: 0 16px;padding-bottom: 20rpx;" class="tools">
@ -104,19 +115,6 @@
</view>
<view class="tui-tool-text">设置</view>
</view>
<view class="tui-tool-item">
<!-- <view class="tuandui_item_left" @tap="goPageLogin('/pages/member/yaoqing')">
团队成员{{oneUserCount}}</view> -->
<view @tap="goPageLogin('/pagesB/pages/my/shareFriends')" class="yaoqing_btn">
邀请好友</view>
</view>
<!-- <view class=" tui-tool-item" v-if="userId" @tap='loginOut()'>
<view class="tui-icon-box">
<image src="https://bwc.xianmxkj.com/img/20210828/e8f096d23a5c4cb0bf0f716901e0ce9a.png"
class="tui-tool-icon"></image>
</view>
<view class="tui-tool-text">退出登录</view>
</view> -->
</view>
</view>
</view>

20
pagesB/pages/member/yaoqing.vue

@ -39,10 +39,10 @@
<view style="font-size: 28upx; color: #333333; width: 65%;">{{ item.nickName }}</view>
</view>
<view style="width: 30%;text-align: center;">
<view style="font-size: 32upx;color: #ffc705;" v-if="item.money != 0">
<view style="font-size: 32upx;color: #FF332F;" v-if="item.money != 0">
{{ item.money ? item.money : '0' }}
</view>
<view style="font-size: 32upx;color: #ffc705;" v-else>{{ item.money ? item.money : '0' }}
<view style="font-size: 32upx;color: #FF332F;" v-else>{{ item.money ? item.money : '0' }}
</view>
</view>
</view>
@ -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;

8
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;
}
</style>

8
pagesB/pages/my/setting.vue

@ -2,9 +2,12 @@
<view class="container">
<view class="setting-box" >
<view class="setting-item" v-for="item in settingList" :key="item.title" @click="navTo(item.path)">
<view class="item-l">
<image :src="item.imgUrl"></image>
<text>{{item.title}}</text>
</view>
<text class="right cuIcon-right"></text>
</view>
</view>
<button @click="loginOut">退出登录</button>
@ -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;

15
pagesB/pages/my/shareFriends.vue

@ -14,7 +14,9 @@
<view v-for="(item,index) in list">
<view style="display: flex;padding: 10rpx;font-size: 28rpx;">
<view>{{index + 1}}
{{item.teamName}}需要邀请{{item.personNum}}成为{{item.teamName}}后一级成员每单返{{item.oneMoney}}积分二级成员每单返{{item.twoMoney}}积分
<!-- {{item.teamName}}需要邀请{{item.personNum}}成为{{item.teamName}}后一级成员每单返{{item.oneMoney}}积分 -->
成为团长需要邀请至少{{item.personNum}}人成为成员成员成功下单奖励团长{{item.oneMoney}}积分
<!-- 二级成员每单返{{item.twoMoney}}积分 -->
</view>
</view>
</view>
@ -28,10 +30,18 @@
</view>
<view style="display: flex;margin-top: 40upx;margin-left: 16rpx;margin-right: 16rpx;margin-bottom: 30rpx;">
<!-- #ifdef MP-WEIXIN -->
<button open-type="share"
style="margin-right: 32upx;text-align: center;width:49%;background: #FFCB49;font-size: 32upx;color: white;border-radius: 20upx;height: 80upx;line-height: 80upx">
分享好友
</button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view @click="shareClick"
style="margin-right: 32upx;text-align: center;width:49%;background: #FFCB49;font-size: 32upx;color: white;border-radius: 20upx;height: 80upx;line-height: 80upx">
分享好友
</view>
<!-- #endif -->
<button @click="showModal()"
style="text-align: center;width: 49%;background: #ED3113;font-size: 32upx;color: white;border-radius: 20upx;height: 80upx;line-height: 80upx">
保存海报
@ -158,6 +168,9 @@
}
},
methods: {
shareClick(){
console.log(this.$jweixin)
},
getUserInfo() {
let userId = this.$queue.getData('userId');
this.$Request.postT("/app/selectUserById?userId=" + userId).then(res => {

6
pagesB/pages/my/teamList.vue

@ -3,21 +3,21 @@
<view class="main">
<view class="integrals-box">
<view class="integral">
<view class="left" @tap="goPageLogin('/pages/member/yaoqing')">
<view class="left" @tap="goPageLogin('/pagesB/pages/member/yaoqing')">
<image src="@/static/img/my/myteam.png"></image>
<text>我的团队</text>
</view>
<text class="right cuIcon-right"></text>
</view>
<view class="integral">
<view class="left" @tap="goPageLogin('/pages/my/my')">
<view class="left" @tap="goPageLogin('/pagesB/pages/my/my')">
<image src="@/static/img/my/teammoney.png"></image>
<text>收益报表</text>
</view>
<text class="right cuIcon-right"></text>
</view>
<view class="integral">
<view class="left" @tap="goPageLogin('/pages/my/shareFriends')">
<view class="left" @tap="goPageLogin('/pagesB/pages/my/shareFriends')">
<image src="@/static/img/my/yaoqing.png"></image>
<text>邀请好友</text>
</view>

Loading…
Cancel
Save