[更新]
This commit is contained in:
@@ -70,6 +70,9 @@ const fridayInfo = (werlfare_id, address_id, is_deliver) => req({url: "welfare/o
|
||||
//周五福利-支付
|
||||
const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POST", data: {trade_no: trade_no}})
|
||||
|
||||
//洗车券-获取跳转地址
|
||||
const washcarUrl = (welfare_id, right_config_id) => req({url: "washcar/infourl", data: {welfare_id: welfare_id, right_config_id: right_config_id}})
|
||||
|
||||
export default({
|
||||
index,
|
||||
choice,
|
||||
@@ -93,5 +96,6 @@ export default({
|
||||
newCity,
|
||||
newidxCity,
|
||||
fridayInfo,
|
||||
fridayPay
|
||||
fridayPay,
|
||||
washcarUrl
|
||||
})
|
||||
|
||||
5
app.json
5
app.json
@@ -25,7 +25,8 @@
|
||||
"pages/packet/packet",
|
||||
"pages/frozen/frozen",
|
||||
"pages/welfare/welfare",
|
||||
"pages/classify/classify"
|
||||
"pages/classify/classify",
|
||||
"pages/washcar/washcar"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
@@ -61,7 +62,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"sendCoupon": {
|
||||
"version" : "1.2.0",
|
||||
"version": "1.2.0",
|
||||
"provider": "wxf3f436ba9bd4be7b"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,9 @@ Page({
|
||||
Snapup(e) {
|
||||
let canBuy = e.currentTarget.dataset.can,
|
||||
canText = e.currentTarget.dataset.text,
|
||||
canId = e.currentTarget.dataset.id
|
||||
canId = e.currentTarget.dataset.id,
|
||||
canFrom = e.currentTarget.dataset.from,
|
||||
canRightid = e.currentTarget.dataset.rightid
|
||||
if(!canBuy) {
|
||||
wx.showToast({
|
||||
title : canText,
|
||||
@@ -193,23 +195,76 @@ Page({
|
||||
return
|
||||
}
|
||||
|
||||
wx.getStorage({
|
||||
key : 'token',
|
||||
success:res=>{
|
||||
if(canFrom == 'washcar') {
|
||||
wx.$api.index.washcarUrl(canId, canRightid).then(res=>{
|
||||
const newUrl = res.data
|
||||
let url= encodeURIComponent(newUrl)
|
||||
wx.redirectTo({
|
||||
// 跳转到webview页面
|
||||
url: `/pages/washcar/washcar?url=${url}`
|
||||
});
|
||||
}).catch(err=>{
|
||||
if(!err.login){
|
||||
// 写入缓存
|
||||
wx.setStorage({
|
||||
key : 'token',
|
||||
data : ''
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 跳转分类页
|
||||
wx.navigateTo({
|
||||
url: '/pages/welfare/welfare?id=' + canId
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 活动中心权益跳转详情
|
||||
*/
|
||||
rightNav(e) {
|
||||
let id = e.currentTarget.dataset.id
|
||||
let id = e.currentTarget.dataset.id,
|
||||
from = e.currentTarget.dataset.from,
|
||||
rightid = e.currentTarget.dataset.rightid
|
||||
|
||||
wx.getStorage({
|
||||
key : 'token',
|
||||
success:res=>{
|
||||
if(from == 'washcar') {
|
||||
wx.$api.index.washcarUrl(id, rightid).then(res=>{
|
||||
const newUrl = res.data
|
||||
let url= encodeURIComponent(newUrl)
|
||||
wx.redirectTo({
|
||||
// 跳转到webview页面
|
||||
url: `/pages/washcar/washcar?url=${url}`
|
||||
});
|
||||
}).catch(err=>{
|
||||
if(!err.login){
|
||||
// 写入缓存
|
||||
wx.setStorage({
|
||||
key : 'token',
|
||||
data : ''
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 跳转分类页
|
||||
wx.navigateTo({
|
||||
url: '/pages/rights/rights?id=' + id
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
wx.navigateTo({
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<view class="cardArr-top">
|
||||
<block wx:if="{{cardArr.length > 0}}">
|
||||
<view bindtap="rightNav" wx:for="{{cardArr}}" wx:key="cardArr" class="indexCard"
|
||||
data-id="{{item.right_config_id}}">
|
||||
data-id="{{item.right_config_id}}" data-from="{{item.from}}" data-rightid="{{item.right_config_id}}">
|
||||
<image class="indexCard-img" src="{{item.cover}}"></image>
|
||||
<view class="nowrap indexCard-title">{{item.title}}</view>
|
||||
<view class="nowrap activity-remark" wx:if="{{item.subtitle != null}}">
|
||||
@@ -90,7 +90,7 @@
|
||||
<view class="WelfareTitle"><text>周五会员福利日</text></view>
|
||||
<view class="WelfareList">
|
||||
<view class="WelfareList-back" bindtap="Snapup" wx:for="{{activities}}" wx:key="activities"
|
||||
data-text="{{item.code_text}}" data-can="{{item.canBuy}}" data-id="{{item.welfare_id}}">
|
||||
data-text="{{item.code_text}}" data-can="{{item.canBuy}}" data-id="{{item.welfare_id}}" data-from="{{item.right.from}}" data-rightId="{{item.right.right_config_id}}">
|
||||
<image class="WelfareList-img {{item.surplus == 0 ? 'active' : ''}}"
|
||||
src="/static/img/welfare_back.png"></image>
|
||||
<view class="WelfareList-left">
|
||||
|
||||
69
pages/washcar/washcar.js
Normal file
69
pages/washcar/washcar.js
Normal file
@@ -0,0 +1,69 @@
|
||||
// pages/webView/webView.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
url:''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
console.log(options.url)
|
||||
this.setData({
|
||||
url : decodeURIComponent(options.url)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
3
pages/washcar/washcar.json
Normal file
3
pages/washcar/washcar.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
pages/washcar/washcar.wxml
Normal file
1
pages/washcar/washcar.wxml
Normal file
@@ -0,0 +1 @@
|
||||
<web-view src="{{url}}"></web-view>
|
||||
1
pages/washcar/washcar.wxss
Normal file
1
pages/washcar/washcar.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/washcar/washcar.wxss */
|
||||
@@ -23,7 +23,7 @@
|
||||
"compileHotReLoad": false,
|
||||
"useMultiFrameRuntime": true,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": false,
|
||||
"useApiHostProcess": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
|
||||
Reference in New Issue
Block a user