代理海报分享与微信lib升级
This commit is contained in:
parent
0227ee60fa
commit
7cb938482d
|
|
@ -25,6 +25,8 @@ module.exports = {
|
|||
GoodsDetail: WxApiRoot + 'goods/detail', //获得商品的详情
|
||||
GoodsRelated: WxApiRoot + 'goods/related', //商品详情页的关联商品(大家都在看)
|
||||
|
||||
CreateShareImg: WxApiRoot + 'agency/createShareImg', //创建分享海报
|
||||
|
||||
BrandList: WxApiRoot + 'brand/list', //品牌列表
|
||||
BrandDetail: WxApiRoot + 'brand/detail', //品牌详情
|
||||
|
||||
|
|
@ -99,6 +101,7 @@ module.exports = {
|
|||
UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息
|
||||
BrokerageMain: WxApiRoot + 'brokerage/main',//佣金收益主页面
|
||||
SettleOrderList: WxApiRoot + 'brokerage/settleOrderList',//佣金收益主页面
|
||||
ApplyWithdrawal: WxApiRoot + 'brokerage/applyWithdrawal',//佣金提现申请
|
||||
ExtractList: WxApiRoot + 'brokerage/extractList',//佣金账号提现记录
|
||||
ArticleDetail: WxApiRoot + 'article/detail',//公告详情
|
||||
ApplyAgency: WxApiRoot + 'user/applyAgency',//代理申请
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<view class='coupon-window {{window==true?"on":""}}'>
|
||||
<view class='couponWinList'>
|
||||
<view class='item acea-row row-between-wrapper' wx:for="{{couponList}}" wx:key>
|
||||
<view class='item acea-row row-between-wrapper' wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
|
||||
<view class='money font-color'>¥<text class='num'>{{item.discount}}</text></view>
|
||||
<view class='text'>
|
||||
<view class='name'>【{{item.desc}}】购物买{{item.min}}减{{item.discount}}</view>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Page({
|
|||
load_statue: true,
|
||||
shopInfo: {
|
||||
name: '聚惠星',
|
||||
address: 'https://gitee.com/qiguliuxing/dts-shop',
|
||||
address: 'https://www.shequlianshang.com/dts/index.html',
|
||||
latitude: 27.4871724214,
|
||||
longitude: 110.8950504844,
|
||||
linkPhone: '19908488612',
|
||||
|
|
|
|||
|
|
@ -3,17 +3,17 @@
|
|||
<view class="item" wx:for="{{accountTraceList}}" wx:key="id" data-address-id="{{item.id}}">
|
||||
<view class="l">
|
||||
<view class="name">{{item.amount}}</view>
|
||||
<view class="default" wx:if="{{item.type == 1}}">提现中</view>
|
||||
<view class="default" wx:if="{{item.type == 2}}">已提现</view>
|
||||
<view class="default" wx:if="{{item.type == 0}}">月结</view>
|
||||
<view class="default" wx:if="{{item.status == 1}}">审批通过</view>
|
||||
<view class="default" wx:if="{{item.status == 2}}">审批拒绝</view>
|
||||
<view class="default" wx:if="{{item.status == 0}}">申请中</view>
|
||||
</view>
|
||||
<view class="c">
|
||||
<view class="mobile" wx:if="{{item.type == 1}}">{{item.mobile}}</view>
|
||||
<view class="mobile" wx:if="{{item.type == 0}}">系统</view>
|
||||
<view class="address">时间:{{item.traceTime}}</view>
|
||||
<view class="mobile" wx:if="{{item.type == 1}}">个人申请</view>
|
||||
<view class="mobile" wx:if="{{item.type == 0}}">系统月结</view>
|
||||
<view class="address">时间:{{item.addTime}}</view>
|
||||
</view>
|
||||
<view class="r">
|
||||
<view class="del">余额:{{item.remainAmount}}</view>
|
||||
<view class="del">总额:{{item.totalAmount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ page {
|
|||
}
|
||||
|
||||
.address-list .l {
|
||||
width: 155rpx;
|
||||
width: 135rpx;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
var api = require('../../../config/api.js');
|
||||
var util = require('../../../utils/util.js');
|
||||
var check = require('../../../utils/check.js');
|
||||
var user = require('../../../utils/user.js');
|
||||
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
|
@ -82,7 +84,7 @@ Page({
|
|||
},
|
||||
goWithdrawal: function() {
|
||||
var that = this;
|
||||
if (this.data.mobile.length == 0 || this.data.code.length == 0) {
|
||||
if (this.data.mobile.length == 0) {
|
||||
wx.showModal({
|
||||
title: '错误信息',
|
||||
content: '手机号和验证码不能为空',
|
||||
|
|
@ -100,7 +102,20 @@ Page({
|
|||
return false;
|
||||
}
|
||||
//调用后台申请提现接口
|
||||
|
||||
util.request(api.ApplyWithdrawal, {
|
||||
mobile: that.data.mobile,
|
||||
amt: that.data.amt
|
||||
}, 'POST').then(function (res) {
|
||||
if (res.errno === 0) {
|
||||
wx.showToast({
|
||||
title: '提现申请成功,等待审批结算'
|
||||
});
|
||||
util.redirect('/pages/brokerage/record/record');
|
||||
} else {
|
||||
util.showErrorToast(res.errmsg);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
bindMobileInput: function(e) {
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<view class="mobile" wx:else>请去设置页面绑定手机</view>
|
||||
</view>
|
||||
|
||||
<!--
|
||||
<view class="form-item-code">
|
||||
<view class="form-item code-item">
|
||||
<input class="code" value="{{code}}" bindinput="bindCodeInput" placeholder="验证码" />
|
||||
|
|
@ -15,7 +16,8 @@
|
|||
</view>
|
||||
<view class="code-btn" bindtap="sendCode">获取验证码</view>
|
||||
</view>
|
||||
|
||||
-->
|
||||
|
||||
<button type="primary" class="register-btn" bindtap="goWithdrawal">发起申请</button>
|
||||
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,18 @@ Page({
|
|||
},
|
||||
|
||||
shareFriendOrCircle: function() {
|
||||
//var that = this;
|
||||
let that = this;
|
||||
util.request(api.CreateShareImg, {
|
||||
shareObjId: that.data.id,
|
||||
type:1 //商品类型的海报图
|
||||
}, 'POST').then(function(res) {
|
||||
if (res.errno === 0) {
|
||||
that.setData({
|
||||
shareImage: res.data.shareUrl
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (this.data.openShare === false) {
|
||||
this.setData({
|
||||
openShare: !this.data.openShare
|
||||
|
|
@ -170,7 +181,7 @@ Page({
|
|||
specificationList: res.data.specificationList,
|
||||
productList: res.data.productList,
|
||||
userHasCollect: res.data.userHasCollect,
|
||||
shareImage: res.data.shareImage,
|
||||
shareImage: res.data.shareImage == null?"":res.data.shareImage,
|
||||
checkedSpecPrice: res.data.info.retailPrice,
|
||||
groupon: res.data.groupon
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
</button>
|
||||
<button class="savesharebtn" open-type="openSetting" bindopensetting="handleSetting" wx:if="{{(!isGroupon) && (!canWrite)}}" >
|
||||
<image class='sharebtn_image' src='/static/images/friend.png'></image>
|
||||
<view class='sharebtn_text'>发朋友圈</view>
|
||||
<view class='sharebtn_text'>保存海报到相册</view>
|
||||
</button>
|
||||
<button class="savesharebtn" bindtap="saveShare" wx:if="{{!isGroupon && canWrite}}">
|
||||
<image class='sharebtn_image' src='/static/images/friend.png'></image>
|
||||
<view class='sharebtn_text'>发朋友圈</view>
|
||||
<view class='sharebtn_text'>保存海报到相册</view>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -88,6 +88,17 @@ Page({
|
|||
let _type = info_arr[0];
|
||||
let id = info_arr[1];
|
||||
|
||||
let shareUserId = null;//默认用户
|
||||
if (info_arr.length == 4 && info_arr[2] == 'user'){
|
||||
shareUserId = info_arr[3];
|
||||
} else if (_type == 'user'){
|
||||
shareUserId = id;
|
||||
}
|
||||
|
||||
if (shareUserId != null){
|
||||
wx.setStorageSync('shareUserId', id);
|
||||
}
|
||||
|
||||
if (_type == 'goods') {
|
||||
wx.navigateTo({
|
||||
url: '../goods/goods?id=' + id
|
||||
|
|
@ -105,9 +116,6 @@ Page({
|
|||
url: '../topicDetail/topicDetail?id=' + id
|
||||
});
|
||||
} else {
|
||||
if (id != null){
|
||||
wx.setStorageSync('shareUserId', id);
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: '../index/index'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<view class='wrapper'>
|
||||
<view class='nav acea-row row-middle'>
|
||||
<view class='item' hover-class='none' wx:if="{{userInfo.userLevel==2}}" bindtap="goBrokerage">
|
||||
<view class='title'>当前佣金</view>
|
||||
<view class='title'>可提佣金</view>
|
||||
<view class='text'><text class='iconfont icon-jinbi1' style="color:#FF654B;margin-right:8rpx;"></text> {{remainAmount || 0.00}}</view>
|
||||
</view>
|
||||
<view class='item' hover-class='none' wx:else>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,15 @@ Page({
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.data.userInfo.phone || this.data.userInfo.phone.length == 0) {
|
||||
wx.showToast({
|
||||
title: '绑定失败:请先绑定手机号',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
util.request(api.ApplyAgency, { desc: "代理申请" }, 'POST').then(function (res) {
|
||||
if (res.errno === 0) {
|
||||
let userInfo = wx.getStorageSync('userInfo');
|
||||
|
|
@ -104,6 +113,39 @@ Page({
|
|||
}
|
||||
});
|
||||
},
|
||||
// 保存推广码到相册
|
||||
saveShare: function () {
|
||||
let that = this;
|
||||
wx.downloadFile({
|
||||
url: that.data.userSharedUrl,
|
||||
success: function (res) {
|
||||
console.log(res)
|
||||
wx.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: function (res) {
|
||||
wx.showModal({
|
||||
title: '推广码下载',
|
||||
content: '推广二维码成功保存到相册!!',
|
||||
showCancel: false,
|
||||
confirmText: '好的',
|
||||
confirmColor: '#a78845',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('fail')
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function () {
|
||||
console.log('fail')
|
||||
}
|
||||
})
|
||||
},
|
||||
exitLogin: function () {
|
||||
wx.showModal({
|
||||
title: '',
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
</view>
|
||||
</view>
|
||||
<view wx:if="{{userSharedUrl && userSharedUrl!=''}}" style="text-align:center;background-color:#fff;">
|
||||
<image class="img" src="{{userSharedUrl}}" style="width:600rpx;height:600rpx;"></image>
|
||||
<view>代理专属推广二维码(长按保存到相册)</view>
|
||||
<image class="img" src="{{userSharedUrl}}" bindlongpress="saveShare" style="width:600rpx;height:600rpx;"></image>
|
||||
</view>
|
||||
<button class='modifyBnt' bindtap="exitLogin">退 出</button>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"setting": {
|
||||
"urlCheck": true,
|
||||
"es6": true,
|
||||
"enhance": false,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
}
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.0.4",
|
||||
"libVersion": "2.9.4",
|
||||
"appid": "wx4901b319ace4f88a",
|
||||
"projectname": "dts-shop",
|
||||
"simulatorType": "wechat",
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue