1、提货点
2、客服(腾讯云智服)
3、接口权限控制
4、复制第三方商品可配置
4、优化附件上传配置
5、手机端核销订单
6、手机端订单统计、订单管理
7、短信优化
8、订阅消息全自动化
pull/1/MERGE
张乐 2020-09-15 16:13:25 +08:00
parent 6685425ae0
commit 8c67e73d43
29 changed files with 1001 additions and 123 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
build.sh
.idea
unpackage

View File

@ -162,7 +162,7 @@ export function switchH5Login(){
// #endif // #endif
/* /*
* h5切换公众号登 * h5切换公众号登
* */ * */
// #ifdef H5 // #ifdef H5
export function switchH5Login() { export function switchH5Login() {
@ -189,9 +189,9 @@ export function logout(){
/** /**
* 获取订阅消息id * 获取订阅消息id
*/ */
export function getTemlIds() export function getTemlIds(data)
{ {
return request.get('wechat/teml_ids', {}, { noAuth:true}); return request.post('wechat/program/my/temp/list?limit=3&page=1', data , { noAuth:true});
} }
/** /**

View File

@ -168,10 +168,11 @@ export function orderRefundVerify(data) {
* 订单确认获取订单详细信息 * 订单确认获取订单详细信息
* @param string cartId * @param string cartId
*/ */
export function orderConfirm(cartId, isNew) { export function orderConfirm(cartId, isNew, addAgain) {
return request.post('order/confirm', { return request.post('order/confirm', {
cartIds: cartId, cartIds: cartId,
isNew: isNew isNew: isNew,
addAgain: addAgain
}, {}, 1); }, {}, 1);
} }
@ -203,3 +204,11 @@ export function orderCreate(key, data) {
export function postOrderComputed(key, data) { export function postOrderComputed(key, data) {
return request.post("order/computed/" + key, data); return request.post("order/computed/" + key, data);
} }
/**
* 将字符串 转base64
* @param object data
*/
export function qrcodeApi(data) {
return request.post('qrcode/str2base64', data, {}, 1);
}

View File

@ -24,7 +24,7 @@ export function getWechatConfig() {
export function wechatAuth(code, spread, login_type) { export function wechatAuth(code, spread, login_type) {
return request.get( return request.get(
"wechat/authorize/login", "wechat/authorize/login",
{ code, spread, login_type }, { code, spread_spid:spread, login_type },
{ noAuth: true } { noAuth: true }
); );
} }
@ -41,7 +41,7 @@ export function getLogo()
/** /**
* 小程序用户登录 * 小程序用户登录
* @param data object 小程序用户登信息 * @param data object 小程序用户登信息
*/ */
export function login(code,data) { export function login(code,data) {
return request.post("wechat/authorize/program/login?code="+code, data, { noAuth : true }); return request.post("wechat/authorize/program/login?code="+code, data, { noAuth : true });

View File

@ -325,7 +325,7 @@ export function getRechargeApi() {
} }
/** /**
* 记录 * 记录
*/ */
export function setVisit(data) export function setVisit(data)
{ {

View File

@ -98,7 +98,7 @@
}) })
}, },
setUserInfo(){ setUserInfo(){
uni.showLoading({title:'正在登中'}); uni.showLoading({title:'正在登中'});
Routine.getCode().then(code=>{ Routine.getCode().then(code=>{
this.getUserInfo(code); this.getUserInfo(code);
}).catch(res=>{ }).catch(res=>{

View File

@ -103,7 +103,7 @@
setUserInfo(e){ setUserInfo(e){
console.log('78878787'); console.log('78878787');
console.log(e); console.log(e);
uni.showLoading({title:'正在登中'}); uni.showLoading({title:'正在登中'});
if(e.detail.errMsg == "getPhoneNumber:ok"){ if(e.detail.errMsg == "getPhoneNumber:ok"){
console.log('授权成功'); console.log('授权成功');
Routine.getCode().then(code=>{ Routine.getCode().then(code=>{

View File

@ -96,4 +96,7 @@
line-height: 86rpx; line-height: 86rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.pictrue image{
background: #f4f4f4;
}
</style> </style>

View File

@ -73,6 +73,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
background: #f4f4f4;
} }
.evaluateWtapper .evaluateItem .pic-text .name { .evaluateWtapper .evaluateItem .pic-text .name {

View File

@ -20,7 +20,7 @@ module.exports = {
//<2F><>ȨlogoС<6F><D0A1><EFBFBD><EFBFBD> //<2F><>ȨlogoС<6F><D0A1><EFBFBD><EFBFBD>
LOGO_URL: 'LOGO_URL', LOGO_URL: 'LOGO_URL',
//模板缓存 //模板缓存
SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE', // SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
TIPS_KEY: 'TIPS_KEY', TIPS_KEY: 'TIPS_KEY',

View File

@ -153,13 +153,14 @@ class AuthWechat {
} }
/** /**
* 授权登获取token * 授权登获取token
* @param {Object} code * @param {Object} code
*/ */
auth(code) { auth(code) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let loginType = Cache.get(LOGINTYPE); let loginType = Cache.get(LOGINTYPE);
wechatAuth(code, parseInt(Cache.get("spread")), loginType) alert(Cache.get("spread"))
wechatAuth(code, Cache.get("spread"), loginType)
.then(({ .then(({
data data
}) => { }) => {
@ -173,6 +174,7 @@ class AuthWechat {
}); });
Cache.set(WX_AUTH, code); Cache.set(WX_AUTH, code);
Cache.clear(STATE_KEY); Cache.clear(STATE_KEY);
// Cache.clear('spread');
loginType && Cache.clear(LOGINTYPE); loginType && Cache.clear(LOGINTYPE);
resolve(); resolve();
}) })
@ -204,7 +206,7 @@ class AuthWechat {
} }
/** /**
* 跳转自动登 * 跳转自动登
*/ */
toAuth() { toAuth() {
let that = this; let that = this;
@ -223,10 +225,6 @@ class AuthWechat {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let configDefault = { let configDefault = {
fail(res) { fail(res) {
console.log('前解放后的金凤凰3');
console.log(res);
console.log(that.instance);
console.log('前解放后的金凤凰2');
if (that.instance) return reject({ if (that.instance) return reject({
is_ready: true, is_ready: true,
wx: that.instance wx: that.instance
@ -236,9 +234,6 @@ class AuthWechat {
is_ready: true, is_ready: true,
wx: wx wx: wx
}); });
console.log('么么么么1');
console.log(wx);
console.log('么么么么2');
}) })
}, },
success(res) { success(res) {

View File

@ -3,8 +3,11 @@ import App from './App'
import store from './store' import store from './store'
import Cache from './utils/cache' import Cache from './utils/cache'
import util from 'utils/util' import util from 'utils/util'
import configs from './config/app.js'
Vue.prototype.$util = util; Vue.prototype.$util = util;
Vue.prototype.$config = configs;
Vue.prototype.$Cache = Cache; Vue.prototype.$Cache = Cache;
Vue.prototype.$eventHub = new Vue(); Vue.prototype.$eventHub = new Vue();
Vue.config.productionTip = false Vue.config.productionTip = false

View File

@ -68,6 +68,13 @@
"desc" : "你的位置信息将用于和门店的距离长度" "desc" : "你的位置信息将用于和门店的距离长度"
} }
}, },
// "plugins" : {
// "chat" : {
// "version" : "1.0.8",
// "provider" : "wx738958e0f4c894f9"
// }
// },
// "sitemapLocation" : "sitemap.json",
"usingComponents" : true "usingComponents" : true
}, },
"mp-alipay" : { "mp-alipay" : {

View File

@ -109,7 +109,7 @@
// #endif // #endif
} }
} }
], ],
"subPackages": [ "subPackages": [
{ {
"root": "pages/users", "root": "pages/users",

View File

@ -216,6 +216,8 @@
<script> <script>
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js' import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// import yzf_chat from '@/plugin/chat/yzf_chat.js'
import store from '@/store';
import { import {
HTTP_REQUEST_URL HTTP_REQUEST_URL
} from '@/config/app.js'; } from '@/config/app.js';
@ -303,7 +305,7 @@
sharePacket: { sharePacket: {
isState: true, // isState: true, //
}, // }, //
uid: 0, //uid // uid: 0, //uid
circular: false, circular: false,
autoplay: false, autoplay: false,
interval: 3000, interval: 3000,
@ -346,8 +348,9 @@
imgTop:'' imgTop:''
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin', 'uid', 'chatUrl']),
onLoad(options) { onLoad(options) {
// this.getChat(this.uid || '');
let that = this let that = this
var pages = getCurrentPages(); var pages = getCurrentPages();
if (pages.length <= 1) { if (pages.length <= 1) {
@ -384,7 +387,7 @@
} else { } else {
this.id = options.id this.id = options.id
} }
//广uid //广
if (options.spid) app.globalData.spid = options.spid; if (options.spid) app.globalData.spid = options.spid;
// #endif // #endif
this.getGoodsDetails(); this.getGoodsDetails();
@ -414,10 +417,32 @@
}, },
// #endif // #endif
methods: { methods: {
getChat(uid){
console.log(this.uid)
window.yzf && window.yzf.init({
sign: '37ef9b97872756ce2a1596ec4fe9b66b0b4cbeec7b36239a65924fa6cbd5c29ac6b013c274511b2eee929e72312baeeeb97aae86',
token: '', //
userAvator:'', //
userNick:'', //
uid: uid, //,
title: '', //
isRMB: '', //,false
data: {
c1: '',
c2: '',
c3: '',
c4: '',
c5: ''
},
selector: 'chat-btn',
callback: function(type, data){}
})
},
kefuClick(){ kefuClick(){
return this.$util.Tips({ location.href = this.chatUrl;
title: '客服功能正在开发中......' // return this.$util.Tips({
}); // title: '......'
// });
}, },
closeChange: function() { closeChange: function() {
this.$set(this.sharePacket, 'isState', true); this.$set(this.sharePacket, 'isState', true);
@ -483,6 +508,12 @@
*去商品详情页 *去商品详情页
*/ */
goDetail(item) { goDetail(item) {
if(!item.activity){
uni.redirectTo({
url: '/pages/goods_details/index?id=' + item.id
})
return
}
if (item.activity.length == 0) { if (item.activity.length == 0) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/goods_details/index?id=' + item.id url: '/pages/goods_details/index?id=' + item.id
@ -526,7 +557,8 @@
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true); that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true);
that.$set(that, 'uid', res.data.uid); store.commit('SETUID', res.data.uid);
// that.$set(that, 'uid', res.data.uid);
// #ifdef H5 // #ifdef H5
that.make(res.data.uid); that.make(res.data.uid);
// #endif // #endif
@ -636,6 +668,7 @@
that.$set(that.attr, 'productAttr', res.data.productAttr); that.$set(that.attr, 'productAttr', res.data.productAttr);
that.$set(that, 'productValue', res.data.productValue); that.$set(that, 'productValue', res.data.productValue);
that.$set(that.sharePacket, 'priceName', res.data.priceName); that.$set(that.sharePacket, 'priceName', res.data.priceName);
console.log(that.sharePacket)
that.$set(that, 'systemStore', res.data.system_store); that.$set(that, 'systemStore', res.data.system_store);
that.$set(that, 'good_list', goodArray); that.$set(that, 'good_list', goodArray);
that.$set(that, 'activity', res.data.activity ? res.data.activity : []); that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
@ -947,7 +980,7 @@
that.attr.cartAttr = false; that.attr.cartAttr = false;
if (news) { if (news) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/order_confirm/index?new=true&cartId=' + res.data.cartId url: '/pages/users/order_confirm/index?new=true&cartId=' + res.data.cartId
}); });
} else { } else {
that.$util.Tips({ that.$util.Tips({
@ -1209,6 +1242,9 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.chat-btn{
background-color: antiquewhite !important;
}
.activity_pin { .activity_pin {
width: auto; width: auto;
height: 44rpx; height: 44rpx;

View File

@ -464,6 +464,12 @@
*去商品详情页 *去商品详情页
*/ */
goDetail(item) { goDetail(item) {
if(!item.activity){
uni.redirectTo({
url: '/pages/goods_details/index?id=' + item.id
})
return
}
if (item.activity.length == 0) { if (item.activity.length == 0) {
uni.redirectTo({ uni.redirectTo({
url: '/pages/goods_details/index?id=' + item.id url: '/pages/goods_details/index?id=' + item.id

View File

@ -40,7 +40,7 @@
<block v-for="(item,index) in imgUrls" :key="index"> <block v-for="(item,index) in imgUrls" :key="index">
<swiper-item> <swiper-item>
<navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' hover-class='none'> <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
<image :src="item.pic" class="slide-image"></image> <image :src="item.pic" class="slide-image" lazy-load></image>
</navigator> </navigator>
</swiper-item> </swiper-item>
</block> </block>
@ -224,6 +224,7 @@
<script> <script>
import Auth from '@/libs/wechat'; import Auth from '@/libs/wechat';
import Cache from '../../utils/cache';
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let app = getApp(); let app = getApp();
import { import {
@ -235,10 +236,10 @@
getTemlIds getTemlIds
// getLiveList // getLiveList
} from '@/api/api.js'; } from '@/api/api.js';
import { // import {
SUBSCRIBE_MESSAGE, // SUBSCRIBE_MESSAGE,
TIPS_KEY // TIPS_KEY
} from '@/config/cache'; // } from '@/config/cache';
// #endif // #endif
// #ifdef H5 // #ifdef H5
import { import {
@ -280,6 +281,7 @@
import { import {
getWechatConfig getWechatConfig
} from "@/api/public"; } from "@/api/public";
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
export default { export default {
computed: mapGetters(['isLogin', 'uid']), computed: mapGetters(['isLogin', 'uid']),
components: { components: {
@ -413,14 +415,21 @@
methods: { methods: {
// #ifdef MP // #ifdef MP
getTemlIds() { getTemlIds() {
let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE); for (var i in arrTemp) {
if (!messageTmplIds) { this.getTem(arrTemp[i]);
getTemlIds().then(res => {
if (res.data)
wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
})
} }
}, },
getTem(data){
getTemlIds({status:true,type:data}).then(res => {
if (res.data) {
let arr = res.data.map((item) => {
return item.tempId
})
//console.log(arr)
wx.setStorageSync('tempID'+ data, arr);
}
})
},
// #endif // #endif
// //
onColse() { onColse() {
@ -608,6 +617,14 @@
// #endif // #endif
}) })
}, },
getChatUrL() {
getWechatConfig().then(res => {
let data = res.data;
this.$store.commit("SET_CHATURL", data.yzfUrl);
Cache.set('chatUrl', data.yzfUrl);
console.log(data)
})
},
// setOpenShare:function(mss){ // setOpenShare:function(mss){
// getWechatConfig() // getWechatConfig()
// .then(res => { // .then(res => {
@ -685,7 +702,7 @@
// #ifdef H5 // #ifdef H5
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '您未登陆,请登陆', content: '您未登录,请登录',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
@ -746,6 +763,7 @@
mounted() { mounted() {
let self = this let self = this
// #ifdef H5 // #ifdef H5
this.getChatUrL();
// H5 // H5
let appSearchH = uni.createSelectorQuery().select(".serch-wrapper"); let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
appSearchH.boundingClientRect(function(data) { appSearchH.boundingClientRect(function(data) {

View File

@ -45,14 +45,16 @@
<view class="title">核销信息</view> <view class="title">核销信息</view>
<view class="grayBg"> <view class="grayBg">
<view class="pictrue"> <view class="pictrue">
<image :src="orderInfo.code"></image> <!-- <div class="qrcode" ref="qrcode"></div> -->
<!-- <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}100%`, height: `${qrcodeSize}100%`}"/> -->
<image :src="codeImg"></image>
</view> </view>
</view> </view>
<view class="gear"> <view class="gear">
<image src="../../static/images/writeOff.jpg"></image> <image src="../../static/images/writeOff.jpg"></image>
</view> </view>
<view class="num">{{orderInfo.verifyCode}}</view> <view class="num">{{orderInfo.verifyCode}}</view>
<view class="rules"> <view class="rules" v-if='orderInfo.systemStore'>
<view class="item"> <view class="item">
<view class="rulesTitle acea-row row-middle"> <view class="rulesTitle acea-row row-middle">
<text class="iconfont icon-shijian"></text>核销时间 <text class="iconfont icon-shijian"></text>核销时间
@ -589,7 +591,8 @@
orderAgain, orderAgain,
orderTake, orderTake,
orderDel, orderDel,
orderCancel orderCancel,
qrcodeApi
} from '@/api/order.js'; } from '@/api/order.js';
import { import {
openOrderRefundSubscribe openOrderRefundSubscribe
@ -609,6 +612,7 @@
} from "vuex"; } from "vuex";
// #ifdef MP // #ifdef MP
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// #endif // #endif
export default { export default {
components: { components: {
@ -621,6 +625,8 @@
}, },
data() { data() {
return { return {
codeImg: '',
qrcodeSize: 100,
order_id: '', order_id: '',
evaluate: 0, evaluate: 0,
cartInfo: [], // cartInfo: [], //
@ -655,7 +661,7 @@
uniId:'' uniId:''
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin', 'chatUrl']),
onLoad: function(options) { onLoad: function(options) {
if (!options.order_id && !options.uniId) return this.$util.Tips({title:'缺少参数'},{tab:3,url:1}); if (!options.order_id && !options.uniId) return this.$util.Tips({title:'缺少参数'},{tab:3,url:1});
this.$set(this, 'order_id', options.order_id); this.$set(this, 'order_id', options.order_id);
@ -691,9 +697,7 @@
}, },
methods: { methods: {
kefuClick(){ kefuClick(){
return this.$util.Tips({ location.href = this.chatUrl;
title: '客服功能正在开发中......'
});
}, },
goGoodCall() { goGoodCall() {
let self = this let self = this
@ -829,6 +833,7 @@
that.isGoodsReturn = true; that.isGoodsReturn = true;
}; };
that.getOrderStatus(); that.getOrderStatus();
that.markCode(res.data.verifyCode);
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
that.$util.Tips({ that.$util.Tips({
@ -836,6 +841,15 @@
}, '/pages/users/order_list/index'); }, '/pages/users/order_list/index');
}); });
}, },
/**
*
* 生成二维码
*/
markCode(text) {
qrcodeApi({ height: '145', text: text, width: '145' }).then(res => {
this.codeImg = res.data.code
});
},
/** /**
* *
* 剪切订单号 * 剪切订单号
@ -899,7 +913,7 @@
let that = this; let that = this;
orderAgain(that.orderInfo.unique).then(res => { orderAgain(that.orderInfo.unique).then(res => {
return uni.navigateTo({ return uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId + '&again=true&new=true' url: '/pages/users/order_confirm/index?cartId=' + res.data.cateId + '&again=true&new=true&addAgain=true'
}); });
}); });
}, },

View File

@ -190,7 +190,8 @@
isShowAuth: false, // isShowAuth: false, //
orderStatusNum: {}, orderStatusNum: {},
userInfo: {}, userInfo: {},
MyMenus: [] MyMenus: [],
wechatUrl: []
} }
}, },
onLoad() { onLoad() {
@ -220,9 +221,10 @@
// }).then(res=>{}) // }).then(res=>{})
// }, // },
kefuClick(){ kefuClick(){
return this.$util.Tips({ location.href = this.wechatUrl[0].wap_url
title: '客服功能正在开发中......' // return this.$util.Tips({
}); // title: '......'
// });
}, },
getOrderData(){ getOrderData(){
let that = this; let that = this;
@ -297,6 +299,14 @@
if (this.MyMenus.length) return; if (this.MyMenus.length) return;
getMenuList().then(res => { getMenuList().then(res => {
that.$set(that, 'MyMenus', res.data.routine_my_menus); that.$set(that, 'MyMenus', res.data.routine_my_menus);
// location.pathname.indexOf('auth') !== -1
// console.log( res.data.routine_my_menus.filter( item => {
// if( item.url.indexOf('service') !== -1 ) return item.wap_url
// }))
this.wechatUrl = res.data.routine_my_menus.filter((item) => {
return item.url.indexOf('service') !== -1
})
console.log(this.wechatUrl)
this.imgUrls = res.data.routine_my_banner this.imgUrls = res.data.routine_my_banner
}); });
}, },

View File

@ -0,0 +1,372 @@
<template>
<div class="register absolute">
<div class="shading">
<div class="pictrue acea-row row-center-wrapper">
<image :src="logoUrl" v-if="logoUrl" />
<image src="/static/images/logo2.png" v-else />
</div>
</div>
<div class="whiteBg" v-if="formItem === 1">
<div class="title acea-row row-center-wrapper">
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
:key="index">
{{ item }}
</div>
</div>
<div class="list" :hidden="current !== 1">
<form @submit.prevent="submit">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" v-model="account" required />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="password" placeholder="填写登录密码" v-model="password" required />
</div>
</div>
</form>
<!-- <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
<span class="iconfont icon-wenti"></span>忘记密码
</navigator> -->
</div>
<div class="list" :hidden="current !== 0">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" v-model="account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
<div class="tip">
<div :hidden="current !== 1">
没有账号?
<span @click="current = 0" class="font-color-red">快速登录</span>
</div>
</div>
</div>
<!-- <div class="whiteBg" v-else>
<div class="title">注册账号</div>
<div class="list">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" v-model="account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_1.png"></image>
<input type="password" placeholder="填写您的登录密码" v-model="password" />
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="register"></div>
<div class="tip">
已有账号?
<span @click="formItem = 1" class="font-color-red">立即登录</span>
</div>
</div> -->
<div class="bottom"></div>
</div>
</template>
<script>
import dayjs from "@/plugin/dayjs/dayjs.min.js";
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
loginH5,
loginMobile,
registerVerify,
register,
// getCodeApi,
getUserInfo
} from "@/api/user";
import attrs, {
required,
alpha_num,
chs_phone
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
import {
getLogo
} from "@/api/public";
import {
VUE_APP_API_URL
} from "@/utils";
const BACK_URL = "login_back_url";
export default {
name: "Login",
mixins: [sendVerifyCode],
data: function() {
return {
navList: ["快速登录", "账号登录"],
current: 0,
account: "",
password: "",
captcha: "",
formItem: 1,
type: "login",
logoUrl: "",
keyCode: "",
codeUrl: "",
codeVal: "",
isShowCode: false
};
},
watch:{
formItem:function(nval,oVal){
if(nval == 1){
this.type = 'login'
}else{
this.type = 'register'
}
}
},
mounted: function() {
this.getCode();
this.getLogoImage();
},
methods: {
again() {
this.codeUrl =
VUE_APP_API_URL +
"/sms_captcha?" +
"key=" +
this.keyCode +
Date.parse(new Date());
},
getCode() {
let that = this
// getCodeApi()
// .then(res => {
// that.keyCode = res.data.key;
// })
// .catch(res => {
// that.$util.Tips({
// title: res
// });
// });
},
async getLogoImage() {
let that = this;
getLogo().then(res => {
that.logoUrl = res.data.logoUrl;
});
},
async loginMobile() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
loginMobile({
account: that.account,
captcha: that.captcha,
spread: that.$Cache.get("spread")
})
.then(res => {
let data = res.data;
let newTime = Math.round(new Date() / 1000);
that.$store.commit("LOGIN", {
'token': data.token
// 'time': dayjs(data.expiresTime) - newTime
});
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
// getUserInfo().then(res => {
that.$store.commit("SETUID", res.data.user.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ===
'/pages/user/index') {
uni.switchTab({
url: backUrl
});
} else {
uni.switchTab({
url: '/pages/index/index'
});
}
// })
})
.catch(res => {
that.$util.Tips({
title: res
});
});
},
async register() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
title: '您输入的密码过于简单'
});
register({
account: that.account,
captcha: that.captcha,
password: that.password,
spread: that.$Cache.get("spread")
})
.then(res => {
that.$util.Tips({
title: res
});
that.formItem = 1;
})
.catch(res => {
that.$util.Tips({
title: res
});
});
},
async code() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
// phone: that.account
// type: that.type,
// key: that.keyCode,
// code: that.codeVal
await registerVerify(that.account)
.then(res => {
that.$util.Tips({title:res.message});
that.sendCode();
})
.catch(res => {
// if (res.data.status === 402) {
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
// that.isShowCode = true;
// }
that.$util.Tips({title:res.message});
});
},
navTap: function(index) {
this.current = index;
},
async submit() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写账号'
});
if (!/^[\w\d]{5,16}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的账号'
});
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
loginH5({
account: that.account,
password: that.password,
spread: that.$Cache.get("spread")
})
.then(({
data
}) => {
// let newTime = Math.round(new Date() / 1000);
that.$store.commit("LOGIN", {
'token': data.token
// 'time': dayjs(data.expiresTime) - newTime
});
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
getUserInfo().then(res => {
that.$store.commit("SETUID", res.data.uid);
if (backUrl === '/pages/index/index' || backUrl === '/pages/order_addcart/order_addcart' || backUrl ==='/pages/user/index') {
uni.switchTab({
url: backUrl
});
} else {
uni.switchTab({
url: '/pages/index/index'
});
}
})
})
.catch(e => {
that.$util.Tips({
title: e
});
});
}
}
};
</script>
<style lang="scss">
.code img {
width: 100%;
height: 100%;
}
.acea-row.row-middle {
input {
margin-left: 20rpx;
}
}
</style>

View File

@ -270,7 +270,8 @@
isShowAuth: false, // isShowAuth: false, //
from: '', from: '',
news: true, news: true,
again: false again: false,
addAgain: false
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
@ -294,6 +295,7 @@
this.is_address = options.is_address ? true : false; this.is_address = options.is_address ? true : false;
this.news = options.new || true; this.news = options.new || true;
this.again = options.again || false; this.again = options.again || false;
this.addAgain = options.addAgain || false;
if (this.isLogin) { if (this.isLogin) {
this.getaddressInfo(); this.getaddressInfo();
this.getConfirm(); this.getConfirm();
@ -361,8 +363,8 @@
* 获取门店列表数据 * 获取门店列表数据
*/ */
getList: function() { getList: function() {
let longitude = uni.getStorageSync("CACHE_LONGITUDE"); // let longitude = uni.getStorageSync("user_longitude"); //
let latitude = uni.getStorageSync("CACHE_LATITUDE"); // let latitude = uni.getStorageSync("user_latitude"); //
let data = { let data = {
latitude: latitude, // latitude: latitude, //
longitude: longitude, // longitude: longitude, //
@ -400,6 +402,7 @@
shippingType: parseInt(shippingType) + 1, shippingType: parseInt(shippingType) + 1,
payType: this.payType payType: this.payType
}).then(res => { }).then(res => {
console.log(res)
let result = res.data.result.result; let result = res.data.result.result;
if (result) { if (result) {
this.totalPrice = result.orderId.payPrice; this.totalPrice = result.orderId.payPrice;
@ -408,7 +411,11 @@
this.integral = this.useIntegral ? result.orderId.surplusIntegral : this.userInfo.integral; this.integral = this.useIntegral ? result.orderId.surplusIntegral : this.userInfo.integral;
this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.orderId.payPostage); this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.orderId.payPostage);
} }
}) }).catch(err => {
return this.$util.Tips({
title: err
});
});
}, },
addressType: function(e) { addressType: function(e) {
let index = e; let index = e;
@ -494,7 +501,7 @@
*/ */
getConfirm: function() { getConfirm: function() {
let that = this; let that = this;
orderConfirm(that.cartId,that.again).then(res => { orderConfirm(that.cartId,that.news,this.addAgain).then(res => {
that.$set(that, 'userInfo', res.data.userInfo); that.$set(that, 'userInfo', res.data.userInfo);
that.$set(that, 'integral', res.data.userInfo.integral); that.$set(that, 'integral', res.data.userInfo.integral);
that.$set(that, 'cartInfo', res.data.cartInfo); that.$set(that, 'cartInfo', res.data.cartInfo);
@ -570,17 +577,21 @@
let that = this; let that = this;
if (that.addressId) { if (that.addressId) {
getAddressDetail(that.addressId).then(res => { getAddressDetail(that.addressId).then(res => {
res.data.isDefault = parseInt(res.data.isDefault); if(res.data){
that.addressInfo = res.data || {}; res.data.isDefault = parseInt(res.data.isDefault);
that.addressId = res.data.id || 0; that.addressInfo = res.data || {};
that.address.addressId = res.data.id || 0; that.addressId = res.data.id || 0;
that.address.addressId = res.data.id || 0;
}
}) })
} else { } else {
getAddressDefault().then(res => { getAddressDefault().then(res => {
res.data.isDefault = parseInt(res.data.isDefault); if(res.data){
that.addressInfo = res.data || {}; res.data.isDefault = parseInt(res.data.isDefault);
that.addressId = res.data.id || 0; that.addressInfo = res.data || {};
that.address.addressId = res.data.id || 0; that.addressId = res.data.id || 0;
that.address.addressId = res.data.id || 0;
}
}) })
} }
}, },
@ -820,8 +831,6 @@
title: '暂无门店,请选择其他方式' title: '暂无门店,请选择其他方式'
}); });
} }
console.log('坎坎坷坷扩');
console.log(that.news);
data = { data = {
realName: that.contacts, realName: that.contacts,
phone: that.contactsTel, phone: that.contactsTel,

View File

@ -108,8 +108,8 @@
that.$set(that,'couponsList',list); that.$set(that,'couponsList',list);
that.$util.Tips({ title: '领取成功' }); that.$util.Tips({ title: '领取成功' });
},function(res){ },function(res){
return that.$util.Tips({title:res.msg}); return that.$util.Tips({title:res});
}); })
}, },
/** /**
* 获取领取优惠券列表 * 获取领取优惠券列表

View File

@ -0,0 +1,373 @@
<template>
<view>
<view class="system-height" :style="{height:statusBarHeight}"></view>
<!-- #ifdef MP -->
<view class="title-bar" style="height: 43px;">
<view class="icon" @click="back" v-if="!isHome"><image src="../static/left.png" ></image></view>
<view class="icon" @click="home" v-else><image src="../static/home.png"></image></view>
账户登录
</view>
<!-- #endif -->
<view class="wechat_login">
<view class="img">
<image src="../static/wechat_login.png" mode="widthFix"></image>
</view>
<view class="btn-wrapper">
<button class="bg-red" hover-class="none" @click="isUp=true"></button>
<!-- #ifdef H5 -->
<button hover-class="none" @click="wechatLogin"></button>
<!-- #endif -->
<!-- #ifdef MP -->
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo"></button>
<!-- #endif -->
</view>
</view>
<block v-if="isUp">
<mobileLogin :isUp="isUp" @close="maskClose" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
</block>
<block v-if="isPhoneBox">
<routinePhone :logoUrl="logoUrl" :isPhoneBox="isPhoneBox" @close="bindPhoneClose" :authKey="authKey"></routinePhone>
</block>
</view>
</template>
<script>
const app = getApp();
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import mobileLogin from '@/components/login_mobile/index.vue'
import routinePhone from '@/components/login_mobile/routine_phone.vue'
import {
getLogo,
silenceAuth,
getUserPhone,
wechatAuthV2
} from '@/api/public';
import {
LOGO_URL,
EXPIRES_TIME,
USER_INFO,
STATE_R_KEY
} from '@/config/cache';
import {
getUserInfo
} from '@/api/user.js'
import Routine from '@/libs/routine';
import wechat from "@/libs/wechat";
export default {
data() {
return {
isUp:false,
phone: '',
statusBarHeight: statusBarHeight,
isHome:false,
isPhoneBox:false,
logoUrl:'',
code:'',
authKey:'',
options:'',
userInfo:{},
codeNum:0
}
},
components:{
mobileLogin,
routinePhone
},
onLoad(options) {
getLogo().then(res=>{
this.logoUrl = res.data.logo_url
})
let that = this
// #ifdef H5
document.body.addEventListener("focusout", () => {
  setTimeout(() => {
    const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
    window.scrollTo(0, Math.max(scrollHeight - 1, 0));
  }, 100);
});
const {
code,
state,
scope
} = options;
this.options = options
// code
this.code = code || ''
if(code){
let spread = app.globalData.spid ? app.globalData.spid : '';
//
wechat.auth(code, state).then(res => {
if (res.key !== undefined && res.key) {
that.authKey = res.key;
that.isUp = true
}else{
let time = res.expires_time - that.$Cache.time();
that.$store.commit('LOGIN', {
token: res.token,
time: time
});
that.userInfo = res.userInfo
that.$store.commit("SETUID", res.userInfo.uid);
that.$store.commit("UPDATE_USERINFO", res.userInfo);
that.wechatPhone()
}
}).catch(error => {
// location.replace("/");
});
}
// #endif
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
if(prePage.route == 'pages/order_addcart/order_addcart'){
this.isHome = true
}else{
this.isHome = false
}
},
methods: {
back(){
uni.navigateBack();
},
home(){
uni.switchTab({
url:'/pages/index/index'
})
},
//
maskClose(){
this.isUp = false
},
bindPhoneClose(data){
if(data.isStatus){
this.isPhoneBox = false
this.$util.Tips({
title:'登录成功',
icon:'success'
},{
tab:3
})
}else{
this.isPhoneBox = false
}
},
// #ifdef MP
//
getphonenumber(e) {
uni.showLoading({
title: '正在登录中'
});
Routine.getCode()
.then(code => {
this.getUserPhoneNumber(e.detail.encryptedData, e.detail.iv, code);
})
.catch(error => {
uni.$emit('closePage', false)
uni.hideLoading();
});
},
//
getUserPhoneNumber(encryptedData, iv, code) {
getUserPhone({
encryptedData: encryptedData,
iv: iv,
code: code,
spid: app.globalData.spid,
spread: app.globalData.code
})
.then(res => {
let time = res.data.expires_time - this.$Cache.time();
this.$store.commit('LOGIN', {
token: res.data.token,
time: time
});
this.userInfo = res.data.userInfo
this.$store.commit("SETUID", res.data.userInfo.uid);
this.$store.commit("UPDATE_USERINFO", res.data.userInfo);
this.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
})
.catch(res => {
console.log(res);
uni.hideLoading();
});
},
/**
* 获取个人用户信息
*/
getUserInfo: function() {
let that = this;
getUserInfo().then(res => {
uni.hideLoading();
that.userInfo = res.data
that.$store.commit("SETUID", res.data.uid);
that.$store.commit("UPDATE_USERINFO", res.data);
that.$util.Tips({
title: '登录成功',
icon: 'success'
}, {
tab: 3
})
});
},
setUserInfo(e) {
uni.showLoading({ title: '正在登录中' });
Routine.getCode()
.then(code => {
this.getWxUser(code);
})
.catch(res => {
uni.hideLoading();
});
},
getWxUser(code){
let self = this
Routine.getUserInfo()
.then(res => {
let userInfo = res.userInfo;
userInfo.code = code;
userInfo.spread_spid = app.globalData.spid; //广ID
userInfo.spread_code = app.globalData.code; //广ID
Routine.authUserInfo(userInfo)
.then(res => {
if(res.data.key !== undefined && res.data.key){
uni.hideLoading();
self.authKey = res.data.key;
self.isPhoneBox = true
}else{
uni.hideLoading();
let time = res.data.expires_time - self.$Cache.time();
self.$store.commit('LOGIN', {
token: res.data.token,
time: time
});
self.$util.Tips({
title:res.msg,
icon:'success'
},{
tab:3
})
}
})
.catch(res => {
uni.hideLoading();
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
});
})
.catch(res => {
uni.hideLoading();
});
},
// #endif
// #ifdef H5
// url
getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var reg_rewrite = new RegExp("(^|/)" + name + "/([^/]*)(/|$)", "i");
var r = window.location.search.substr(1).match(reg);
var q = window.location.pathname.substr(1).match(reg_rewrite);
if(r != null){
return unescape(r[2]);
}else if(q != null){
return unescape(q[2]);
}else{
return null;
}
},
//
wechatLogin(){
if(!this.code){
this.$wechat.oAuth('','/pages/users/wechat_login/index')
}else{
}
},
//
wechatPhone(){
if(this.options.back_url){
let url = uni.getStorageSync('snRouter')
let self = this
this.isUp = false
uni.showToast({
title:'登录成功',
icon:'none'
})
setTimeout(res=>{
location.href = url.indexOf("/pages/index/index") != -1?'/':url
},800)
}else{
uni.navigateBack()
}
}
// #endif
}
}
</script>
<style lang="scss" scoped>
page {
background: #fff;
}
.wechat_login {
padding: 72rpx 34rpx;
.img image {
width: 100%;
}
.btn-wrapper {
margin-top: 86rpx;
button {
width: 100%;
height: 86rpx;
line-height: 86rpx;
margin-bottom: 40rpx;
color: $theme-color;
border: 1px solid $theme-color;
border-radius: 120rpx;
font-size: 30rpx;
&.bg-red {
background: $theme-color;
color: #fff;
}
}
}
}
.title-bar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
.icon{
position: absolute;
left: 30rpx;
top: 0;
display: flex;
align-items: center;
justify-content: center;
width: 86rpx;
height: 86rpx;
image{
width: 50rpx;
height: 50rpx;
}
}
</style>

1
plugin/chat/yzf_chat.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ export default {
uid:state => state.app.uid, uid:state => state.app.uid,
homeActive: state => state.app.homeActive, homeActive: state => state.app.homeActive,
home: state => state.app.home, home: state => state.app.home,
chatUrl: state => state.app.chatUrl
}; };
// export default { // export default {
// token: state => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrYWlmYS5jcm1lYi5uZXQiLCJhdWQiOiJrYWlmYS5jcm1lYi5uZXQiLCJpYXQiOjE1NzcwODM1MzQsIm5iZiI6MTU3NzA4MzUzNCwiZXhwIjoxNTc3MDk0MzM0LCJqdGkiOnsiaWQiOjExMCwidHlwZSI6InVzZXIifX0.U-i1pbdRjyXI1gr79Uq2XBPZ89T8f5Ai9jwrR8woTwE', // token: state => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrYWlmYS5jcm1lYi5uZXQiLCJhdWQiOiJrYWlmYS5jcm1lYi5uZXQiLCJpYXQiOjE1NzcwODM1MzQsIm5iZiI6MTU3NzA4MzUzNCwiZXhwIjoxNTc3MDk0MzM0LCJqdGkiOnsiaWQiOjExMCwidHlwZSI6InVzZXIifX0.U-i1pbdRjyXI1gr79Uq2XBPZ89T8f5Ai9jwrR8woTwE',

View File

@ -16,6 +16,7 @@ const state = {
userInfo: null, userInfo: null,
uid: Cache.get(UID) || null, uid: Cache.get(UID) || null,
homeActive: false, homeActive: false,
chatUrl: Cache.get('chatUrl') || '',
}; };
const mutations = { const mutations = {
@ -49,6 +50,9 @@ const mutations = {
CLOSE_HOME(state) { CLOSE_HOME(state) {
state.homeActive = false; state.homeActive = false;
}, },
SET_CHATURL(state, chatUrl){
state.chatUrl = chatUrl;
}
}; };
const actions = { const actions = {

View File

@ -1,25 +1,22 @@
import { // import {
SUBSCRIBE_MESSAGE // SUBSCRIBE_MESSAGE
} from '../config/cache.js'; // } from '../config/cache.js';
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
export function auth() { // export function auth() {
let tmplIds = {}; // let tmplIds = {};
let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE); // let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE);
tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {}; // tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {};
return tmplIds; // return tmplIds;
} // }
/** /**
* 支付成功后订阅消息id * 支付成功后订阅消息id
* 订阅 确认收货通知 订单支付成功 新订单管理员提醒 * 订阅 确认收货通知 订单支付成功 新订单管理员提醒
*/ */
export function openPaySubscribe() { export function openPaySubscribe() {
let tmplIds = auth(); let tmplIds = uni.getStorageSync('tempID' + arrTemp[0]);
return subscribe([ return subscribe(tmplIds);
tmplIds.oreder_takever,
tmplIds.order_pay_success,
tmplIds.order_new,
]);
} }
/** /**
@ -27,12 +24,8 @@ export function openPaySubscribe() {
* 送货 发货 取消订单 * 送货 发货 取消订单
*/ */
export function openOrderSubscribe() { export function openOrderSubscribe() {
let tmplIds = auth(); let tmplIds = uni.getStorageSync('tempID' + arrTemp[1]);
return subscribe([ return subscribe(tmplIds);
tmplIds.order_deliver_success,
tmplIds.order_postage_success,
tmplIds.order_clone
]);
} }
/** /**
@ -40,10 +33,8 @@ export function openOrderSubscribe() {
* 成功 失败 消息 * 成功 失败 消息
*/ */
export function openExtrctSubscribe() { export function openExtrctSubscribe() {
let tmplIds = auth(); let tmplIds = uni.getStorageSync('tempID' + arrTemp[2]);
return subscribe([ return subscribe(tmplIds);
tmplIds.user_extract
]);
} }
/** /**
@ -70,25 +61,25 @@ export function openBargainSubscribe() {
* 订单退款 * 订单退款
*/ */
export function openOrderRefundSubscribe() { export function openOrderRefundSubscribe() {
let tmplIds = auth(); let tmplIds = uni.getStorageSync('tempID' + arrTemp[3]);
return subscribe([tmplIds.order_refund]); return subscribe(tmplIds);
} }
/** /**
* 充值成功 * 充值成功
*/ */
export function openRechargeSubscribe() { export function openRechargeSubscribe() {
let tmplIds = auth(); let tmplIds = uni.getStorageSync('tempID' + arrTemp[4]);
return subscribe([tmplIds.recharge_success]); return subscribe(tmplIds);
} }
/** // /**
* 提现 // * 提现
*/ // */
export function openEextractSubscribe() { // export function openEextractSubscribe() {
let tmplIds = auth(); // let tmplIds = JSON.parse(uni.getStorageSync('tempID' + paySubscribe));
return subscribe([tmplIds.user_extract]); // return subscribe(tmplIds);
} // }
/** /**
* 调起订阅界面 * 调起订阅界面

View File

@ -2,7 +2,7 @@ import { spread } from "@/api/user";
import Cache from "@/utils/cache"; import Cache from "@/utils/cache";
/** /**
* 绑定用户授权 * 静默授权绑定上下级使用在已经登录后扫描了别人的推广二维码
* @param {Object} puid * @param {Object} puid
*/ */
export function silenceBindingSpread() export function silenceBindingSpread()
@ -25,20 +25,21 @@ export function silenceBindingSpread()
puid = 0; puid = 0;
} }
if(puid){ if(puid){
spread(puid).then(res=>{ //#ifdef H5
console.log(res); Cache.set('spread', 0);
//#ifdef H5 //#endif
Cache.clear('spread');
//#endif //#ifdef MP
getApp().globalData.spid = 0;
//#ifdef MP getApp().globalData.code = 0;
getApp().globalData.spid = 0; //#endif
getApp().globalData.code = 0; // spread(puid).then(res=>{
//#endif // console.log(res);
// }).catch(res=>{
}).catch(res=>{ // console.log(res);
console.log(res); // });
}); }else{
Cache.set('spread', 0);
} }
} }

View File

@ -27,7 +27,7 @@ function baseRequest(url, method, data, {
if (!store.state.app.token && !checkLogin()) { if (!store.state.app.token && !checkLogin()) {
toLogin(); toLogin();
return Promise.reject({ return Promise.reject({
msg: '未登' msg: '未登'
}); });
} }
} }