Commit 9880d0d7 by 高淑倩

status_组件

parent 0ee17334
{"tabs":["file:///f%3A/code/7_Eleven_Alipay/app.json"],"current":"file:///f%3A/code/7_Eleven_Alipay/app.json"}
\ No newline at end of file
{"tabs":["file:///f%3A/code/7_Eleven_Alipay/pages/pointList/pointList.axml","file:///f%3A/code/7_Eleven_Alipay/component/statusPoint/statusPoint.js","file:///f%3A/code/7_Eleven_Alipay/component/statusPoint/statusPoint.json","file:///f%3A/code/7_Eleven_Alipay/component/statusPoint/statusPoint.axml"],"current":"file:///f%3A/code/7_Eleven_Alipay/component/statusPoint/statusPoint.axml"}
\ No newline at end of file
{"files":["f:\\code\\7_Eleven_Alipay\\app.json","f:\\code\\7_Eleven_Alipay\\utils\\Http.js","f:\\code\\7_Eleven_Alipay\\utils\\util.js","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.axml","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.js","f:\\code\\7_Eleven_Alipay\\utils\\wxService.js","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.json","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.acss","f:\\code\\7_Eleven_Alipay\\wx2my.js","f:\\code\\7_Eleven_Alipay\\project.config.json","f:\\code\\7_Eleven_Alipay\\package-lock.json","f:\\code\\7_Eleven_Alipay\\Behavior.js","f:\\code\\7_Eleven_Alipay\\app.js","f:\\code\\7-Eleven\\src_output\\utils\\util.js","f:\\code\\7-Eleven\\src_output\\component\\authorization-modal\\authorization-modal.js","f:\\code\\7-Eleven\\src_output\\pages\\userCenter\\userCenter.js","f:\\code\\7-Eleven\\src_output\\utils\\wxService.js","f:\\code\\7-Eleven\\src_output\\app.js","f:\\code\\7-Eleven\\src_output\\component\\authorization-modal\\authorization-modal.axml","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.axml","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.acss","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.js","f:\\code\\7-Eleven\\src_output\\utils\\common.js","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.js","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.axml","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.json","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.js","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.axml","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.acss","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\subPage\\subPage.js","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.js","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.axml","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.acss","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.acss","f:\\code\\7-Eleven\\src_output\\app.json","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.json","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.axml","f:\\code\\7-Eleven\\src_output\\pages\\coupons\\coupons.acss","f:\\code\\7-Eleven\\src_output\\component\\picNav\\picNav.js","f:\\code\\7-Eleven\\src_output\\utils\\Http.js","f:\\code\\7-Eleven\\src_output\\component\\noMore\\noMore.js","f:\\code\\7-Eleven\\src_output\\component\\authorization-modal\\authorization-modal.acss","f:\\code\\7-Eleven\\src_output\\pages\\userCenter\\userCenter.axml","f:\\code\\7-Eleven\\src_output\\pages\\userCenter\\userCenter.acss","f:\\code\\7-Eleven\\src_output\\component\\picNav\\picNav.axml","f:\\code\\7-Eleven\\src_output\\codeUtils\\qrcode.js","f:\\code\\7-Eleven\\src_output\\utils\\renderPage.js","f:\\code\\7-Eleven\\src_output\\lib\\bluebird.js","f:\\code\\7-Eleven\\src_output\\codeUtils\\barcode.js","f:\\code\\7-Eleven\\src_output\\component\\picNav\\picNav.acss"]}
\ No newline at end of file
{"files":["f:\\code\\7_Eleven_Alipay\\component\\statusPoint\\statusPoint.axml","f:\\code\\7_Eleven_Alipay\\component\\statusPoint\\statusPoint.json","f:\\code\\7_Eleven_Alipay\\component\\statusPoint\\statusPoint.js","f:\\code\\7_Eleven_Alipay\\component\\statusPoint\\statusPoint.acss","f:\\code\\7_Eleven_Alipay\\utils\\helper.js","f:\\code\\7_Eleven_Alipay\\utils\\wxService.js","f:\\code\\7_Eleven_Alipay\\pages\\pointList\\pointList.js","f:\\code\\7_Eleven_Alipay\\pages\\pointList\\tools.wxs","f:\\code\\7_Eleven_Alipay\\pages\\pointList\\pointList.axml","f:\\code\\7_Eleven_Alipay\\pages\\pointList\\pointList.acss","f:\\code\\7_Eleven_Alipay\\pages\\pointList\\pointList.json","f:\\code\\7_Eleven_Alipay\\pages\\pointDetail\\pointDetail.json","f:\\code\\7_Eleven_Alipay\\pages\\pointDetail\\pointDetail.js","f:\\code\\7_Eleven_Alipay\\pages\\pointDetail\\pointDetail.acss","f:\\code\\7_Eleven_Alipay\\app.json","f:\\code\\7_Eleven_Alipay\\utils\\Http.js","f:\\code\\7_Eleven_Alipay\\utils\\util.js","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.axml","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.js","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.json","f:\\code\\7_Eleven_Alipay\\component\\authorization-modal\\authorization-modal.acss","f:\\code\\7_Eleven_Alipay\\wx2my.js","f:\\code\\7_Eleven_Alipay\\project.config.json","f:\\code\\7_Eleven_Alipay\\package-lock.json","f:\\code\\7_Eleven_Alipay\\Behavior.js","f:\\code\\7_Eleven_Alipay\\app.js","f:\\code\\7-Eleven\\src_output\\utils\\util.js","f:\\code\\7-Eleven\\src_output\\component\\authorization-modal\\authorization-modal.js","f:\\code\\7-Eleven\\src_output\\pages\\userCenter\\userCenter.js","f:\\code\\7-Eleven\\src_output\\utils\\wxService.js","f:\\code\\7-Eleven\\src_output\\app.js","f:\\code\\7-Eleven\\src_output\\component\\authorization-modal\\authorization-modal.axml","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.axml","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.acss","f:\\code\\7-Eleven\\src_output\\component\\bottom\\bottom.js","f:\\code\\7-Eleven\\src_output\\utils\\common.js","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.js","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.axml","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\h5\\h5page.json","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.js","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.axml","f:\\code\\7-Eleven\\src_output\\component\\imageSwiper\\imageSwiper.acss","f:\\code\\7-Eleven\\src_output\\subPackage\\page\\pages\\subPage\\subPage.js","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.js","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.axml","f:\\code\\7-Eleven\\src_output\\pages\\mySpend\\mySpend.acss","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.acss","f:\\code\\7-Eleven\\src_output\\app.json","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.json","f:\\code\\7-Eleven\\src_output\\pages\\IntegralMall\\IntegralMall.axml"]}
\ No newline at end of file
/* component/noMore.wxss */
.detail-list-bottom {
@import './../../base/base.acss';
.status {
height: 320rpx;
border-radius: 8rpx;
position: relative;
overflow: hidden;
}
.status-tips {
width: 130rpx;
height: 58rpx;
margin-top: 12px;
box-sizing: border-box;
position: absolute;
color: #fff;
text-align: center;
font-size: 21rpx;
color: #bfbfbf;
/* margin-top: 45rpx; */
line-height: 58rpx;
font-size: 24rpx;
border-radius: 10rpx 100rpx 100rpx 10rpx;
}
.status-img {
border-radius: 8rpx;
height: 100%;
width: 100%;
}
\ No newline at end of file
<!--component/noMore.axml-->
<view class="detail-list-bottom">-已经到底啦-</view>
\ No newline at end of file
<view class="status" style="height: {{imgHeight}}rpx" wx:if="{{img}}">
<view class="status-tips" style="background-color:rgba(5, 195, 91, 1);" wx:if="{{currentStatus == 2 && currentTimeStatus == 1}}">进行中 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentStatus == 3}}"> 已失效 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 2}}">已结束 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:elif="{{currentTimeStatus == 3}}">未开始 >></view>
<view class="status-tips" style="background-color:rgb(170, 170, 170);" wx:else>已结束 >></view>
<!--<image class='status-tips' src='/assets/imgs/point/status.png' mode="widthFix"/>-->
<image wx:if="{{img}}" class='status-img' src='{{img}}' />
</view>
\ No newline at end of file
......@@ -2,6 +2,25 @@ const wx2my = require('../../wx2my');
const Behavior = require('../../Behavior');
// component/noMore.js
Component({
properties: {
img: {
type: String,
value: '',
},
imgHeight: {
type: Number,
value: 320
},
currentStatus: {
type: Number,
value: 2
},
currentTimeStatus: {
type: Number,
value: 1
},
},
/**
* 页面的初始数据
*/
......
/* pages/userCenter.wxss */
@import './../../base/base.acss';
page{
background-color: #ffffff;
}
.page-mySpend{
padding: 0 32rpx;
}
.spend-wrap{
padding: 28rpx 0;
border-bottom: 1px solid #e5e5e5;
}
.spend-id{
color: #999999;
}
.spend-time,.spend-shop{
color: #666666;
}
.spend-list{
position: relative;
}
.spend-status{
color: #05c35b;
position: absolute;
right: 0;
bottom: 0;
}
.fail-status{
color: #999999;
}
.no-bottom {
margin: 50rpx 0;
}
.detail-list-no {
page {
background-color: #fff;
}
.point-list {
padding-bottom: 30rpx;
}
.point {
padding: 30rpx 30rpx 0 30rpx;
}
.status-img {
height: 320rpx;
}
.progress {
height: 70rpx;
line-height: 70rpx;
border-bottom: 1px solid rgba(151, 151, 151, .3);
}
.rate {
/* width: 137rpx; */
height: 33rpx;
color: rgba(51, 51, 51, 1);
font-size: 24rpx;
text-align: left;
font-family: PingFangSC-Regular;
}
.time-out {
/* width: 279px; */
height: 33px;
color: rgba(120, 120, 120, 1);
font-size: 24rpx;
text-align: right;
font-family: PingFangSC-Regular;
}
.time {
color: #000;
}
.point--no-list {
display: flex;
align-items: center;
justify-content: center;
color: rgba(120, 120, 120, 1);
font-size: 24rpx;
padding-top: 200rpx;
text-align: center;
color: #cccccc;
font-size: 28rpx;
}
\ No newline at end of file
<!--pages/userCenter.axml-->
<view a:if="{{!orderList.length}}" class="detail-list-no">还没有任何消费记录</view>
<view class="page-mySpend" a:if="{{orderList.length}}">
<scroll-view scroll-y onScrollToLower="bindDownLoad">
<view
class="spend-wrap"
a:for="{{orderList}}"
a:for-item="item"
a:for-index="k"
a:key="{{k}}"
>
<view
class="spend-list"
data-order-no="{{item.orderNo}}"
onTap="goDetail"
>
<view class="spend-id fs-22">订单编号:{{item.orderNo}}</view>
<view class="spend-time fs-25">消费时间:{{item.payTime}}</view>
<view class="spend-shop fs-25">消费门店:{{item.storeName}}</view>
<view class="spend-status fs-22">交易成功</view>
</view>
</view>
</scroll-view>
<view class="no-bottom">
<no-more a:if="{{noMore}}"/>
<wxs src="./tools.wxs" module="tools" />
<view class="point--no-list border_box" wx:if="{{!pointList.length}}">
<text>您当前暂无集点活动</text>
</view>
<view class="point-list border_box" wx:if="{{pointList.length}}">
<block wx:for="{{pointList}}" wx:key="item">
<view class="point border_box" data-id="{{item.id}}" bindtap="handleDetail">
<status-img img="{{item.listImage}}" currentStatus="{{currentStatus}}" currentTimeStatus="{{currentTimeStatus}}" />
</view>
</block>
</view>
\ No newline at end of file
......@@ -14,13 +14,20 @@ wxService.page({
* 页面的初始数据
*/
data: {
pageNo: 1,
pageSize: 10,
totalPages: '',
orderList: [],
noMore: false
pointList: [],
currentStatus: 2, // 活动状态 1 未生效 2 生效中 3 已失效 0 已删除
currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始
},
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
this.getPointList()
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
}
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -30,16 +37,100 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
// const { orderNo } = this.options
this.initOrderList(this.data.pageNo, this.data.pageSize);
},
getPointConsumptionCount(activityId) {
const { memberId } = wx.getStorageSync('_baseUserInfo')
// 会员集点活动统计信息
wxService.post(`/sale/touchpoints/pointConsumptionCount/getPointConsumptionCount?activityId=${activityId}&memberId=${memberId}`).then(res => {
if (res) {
const { result, data } = res.data
const { pointList } = this.data
if (result == 0) {
pointList.forEach(item => {
if (item.id == data.activityId) {
item.surplusPoints = data.surplusPoints
item.totalPoints = data.totalPoints
item.surplusExchangeCount = data.surplusExchangeCount
this.setData({
pointList
})
}
})
}
}
})
},
handleDetail(e) {
const { id } = e.currentTarget.dataset
wxService.router(`/pages/pointDetail/pointDetail`).search({ id })
},
getPointList() {
wx.showLoading({
title: '加载中'
})
wxService.get(`/sale/touchpoints/pointConsumptionActivity/findAllValidActivityList`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
data.forEach(item => {
// 是否在有效期
let timeFlag = 1
let endT = item.endTime
let startT = item.startTime
// ios 兼容
let currentEndTime = (new Date(endT.replace(/-/g, '/'))).getTime();
let currentstartTime = (new Date(startT.replace(/-/g, '/'))).getTime();
let currentTime = (new Date()).getTime();
goDetail(e) {
const {
orderNo
} = e.currentTarget.dataset; // pages/consumptionDetails/consumptionDetails
// 开始时间 小于 现在 && 小于 结束时间 进行中
if (currentstartTime < currentTime && currentTime < currentEndTime) {
timeFlag = 1
} else if (currentEndTime < currentTime) {
// 结束时间 小于 现在时间 已结束
timeFlag = 2
} else if (currentTime < currentstartTime) {
// 未开始
timeFlag = 3
}
wxService.router(`/pages/consumptionDetails/consumptionDetails?orderNo=${orderNo}`);
let distancetime = currentEndTime - currentTime
let result = {
day: '00',
hour: '00',
min: '00',
sec: '00',
ms: '00',
isOver: true,
};
if (distancetime > 0) {
//如果大于0.说明尚未到达截止时间
result.ms = Math.floor((distancetime % 1000) / 100);
result.sec = Math.floor((distancetime / 1000) % 60);
result.min = Math.floor((distancetime / 1000 / 60) % 60);
result.hour = Math.floor((distancetime / 1000 / 60 / 60) % 24);
result.day = Math.floor((distancetime / 1000 / 60 / 60) / 24);
result.isOver = false;
// if (result.ms < 10) result.ms = result.ms;
// if (result.sec < 10) result.sec = '0' + result.sec;
// if (result.min < 10) result.min = '0' + result.min;
// if (result.hour < 10) result.hour = '0' + result.hour;
// if (result.day < 10) result.day = '0' + result.day;
}
item.countdown = result
this.setData({
pointList: data,
currentStatus: item.status,
currentTimeStatus: timeFlag
}, () => {
wx.hideLoading()
this.getPointConsumptionCount(item.id)
})
})
}
}
})
},
//获取消费列表
......
{
"usingComponents": {
"no-more": "/component/noMore/noMore"
"status-img": "/component/statusPoint/statusPoint"
},
"defaultTitle": "我的消费",
"defaultTitle": "集点列表",
"pullRefresh": true
}
\ No newline at end of file
var pathJson = {
'7.1': [ // 版本对应路径
'pages/pointList/pointList',
'pages/pointDetail/pointDetail'
]
}
module.exports = pathJson
\ No newline at end of file
......@@ -99,6 +99,13 @@ export function getAppUserInfo() {
return Promise.reject(new Error('userinfo is null'));
}
}
export function getCurrentRouter () {
var pages = getCurrentPages() // 获取加载的页面
var currentPage = pages[pages.length - 1] // 获取当前页面的对象
return currentPage
}
export default {
c1C2Map,
c2C3Map
......
function observe(obj, key, watchFun, deep, page) {
let val = obj[key];
if (val != null && typeof val === "object" && deep) {
Object.keys(val).forEach((item) => {
observe(val, item, watchFun, deep, page);
});
}
Object.defineProperty(obj, key, {
configurable: true,
enumerable: true,
set: function(value) {
watchFun.call(page, value, val);
val = value;
if (deep) {
observe(obj, key, watchFun, deep, page);
}
},
get: function() {
return val;
}
});
}
export function setWatcher(page) {
let data = page.data;
let watch = page.watch;
if(!watch) return false
Object.keys(watch).forEach((item) => {
let targetData = data;
let keys = item.split(".");
for (let i = 0; i < keys.length - 1; i++) {
targetData = targetData[keys[i]];
}
let targetKey = keys[keys.length - 1];
let watchFun = watch[item].handler || watch[item];
let deep = watch[item].deep;
observe(targetData, targetKey, watchFun, deep, page);
});
}
......@@ -5,17 +5,15 @@ import Router from './router';
import ManageDate from './manageDate';
import { cEvent } from './event';
import Http from './Http';
const Promise = require('../lib/bluebird');
const config = require('../config/index').envInfo;
import utils from './util';
let openCardLister = null;
import * as watch from "./watch.js";
const pathData = require('./currentAccessiblePath.js')
/**
* 单例
*/
const manageDate = new ManageDate();
class WXService extends Http {
......@@ -192,7 +190,8 @@ class WXService extends Http {
});
} else if (res.data.data.isMember === '1') {
let baseUserInfo = this.getBaseUserInfo();
let newBaseUserInfo = { ...baseUserInfo,
let newBaseUserInfo = {
...baseUserInfo,
...res.data.data
};
this.baseUserInfo = newBaseUserInfo;
......@@ -230,7 +229,7 @@ class WXService extends Http {
scrollOffset() {
return new Promise((resolve, reject) => {
wx2my.createSelectorQuery().selectViewport().scrollOffset(function (res) {
wx2my.createSelectorQuery().selectViewport().scrollOffset(function(res) {
resolve(res);
}).exec();
});
......@@ -238,7 +237,8 @@ class WXService extends Http {
showModal(config = {}) {
return new Promise((resolve, reject) => {
wx2my.showModal({ ...config,
wx2my.showModal({
...config,
success: res => {
if (res.confirm) {
config.success ? config.success(res) : resolve(res);
......@@ -252,6 +252,44 @@ class WXService extends Http {
});
});
}
getAssPath() {
const paths = pathData
let pathArr = []
for (const key in paths) {
if (paths.hasOwnProperty(key)) {
let pathObj = {}
pathObj[key] = paths[key]
pathArr.push(pathObj)
}
}
return pathArr
}
trialList() {
let localPath = this.getAssPath()
my.showLoading({
title: '加载中'
})
return this.get(`/member/trial/list`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
my.hideLoading()
// 对应的path
let currentPaths = [];
localPath.forEach(item => {
if (item.hasOwnProperty(data)) {
currentPaths = item[data]
} else {
console.log(222);
}
})
return Promise.resolve({ currentPaths })
}
}
})
}
getSystemInfo() {
return new Promise((resolve, reject) => {
......@@ -262,7 +300,7 @@ class WXService extends Http {
fail: res => {
reject(res);
},
complete: res => {}
complete: res => { }
});
});
} // handlerPage (page) {
......@@ -338,34 +376,52 @@ class WXService extends Http {
page(config) {
const _self = this;
config.data.experAccessible;
const CONFIG_PAPGE = {
onLoad: function (...args) {
onLoad: function(...args) {
const page = this;
_self.initAppGlobalDataSync();
watch.setWatcher(page);
config.onLoad && config.onLoad.apply(page, args);
},
onShow: function (...args) {
onShow: function(...args) {
const page = this;
_self.currentPage = page;
config.onShow && config.onShow.apply(page, args);
// 获取当前页
let router = getCurrentRouter()
const baseUserInfo = _self.getBaseUserInfo()
if (baseUserInfo) {
_self.trialList().then(res => {
if (!res) return false
const { currentPaths } = res
if (currentPaths.indexOf(router.route) > -1 && isExperiencer) {
this.setData({
experAccessible: true
})
} else {
this.setData({
experAccessible: false
})
}
})
}
},
onReady: function (...args) {
onReady: function(...args) {
config.onReady && config.onReady.apply(this, args);
},
onHide: function (...args) {
onHide: function(...args) {
const page = this;
config.onHide && config.onHide.apply(this, args);
},
onUnload: function (...args) {
onUnload: function(...args) {
config.onUnload && config.onUnload.apply(this, args);
},
onPageScroll: function (...args) {
onPageScroll: function(...args) {
config.onPageScroll && config.onPageScroll.apply(this, args);
},
onShareAppMessage: function (...args) {
onShareAppMessage: function(...args) {
const page = this;
const baseUserInfo = wx2my.getStorageSync('_baseUserInfo');
let openId = '';
......@@ -379,7 +435,7 @@ class WXService extends Http {
try {
let shareConfig = config.onShareAppMessage.apply(this, args);
if (!shareConfig) {} else {}
if (!shareConfig) { } else { }
return shareConfig;
} catch (e) {
......@@ -435,7 +491,7 @@ class WXService extends Http {
fail: res => {
reject(res);
},
complete: () => {}
complete: () => { }
});
});
}
......@@ -445,7 +501,7 @@ class WXService extends Http {
const promise = new Promise((resolve, reject) => {
if (!openCardLister) {
openCardLister = cEvent.on('openCardSuccess', function (data) {
openCardLister = cEvent.on('openCardSuccess', function(data) {
openCardLister = null;
resolve(data);
});
......@@ -477,11 +533,11 @@ class WXService extends Http {
// 固定为此 appid,不可改动
extraData: options,
// 包括 encrypt_card_id, outer_str, biz三个字段,须从 step3 中获得的链接中获取参数
success: function (data) {
success: function(data) {
console.log('navigateToMiniProgram success data is %o', data);
_self.lock = false;
},
fail: function (data) {
fail: function(data) {
console.log('navigateToMiniProgram fail data is %o', data);
this.router('/pages/userCenter/userCenter'); // this.router('/pages/welcome/welcome')
......@@ -539,10 +595,10 @@ class WXService extends Http {
return my.addCardAuth({
url: '从 openapi 接口获取到的 url',
success: (res) => {
my.alert({content: '授权成功'});
my.alert({ content: '授权成功' });
},
fail: (res) => {
my.alert({content: '授权失败'});
my.alert({ content: '授权失败' });
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment