[更新]
This commit is contained in:
@@ -73,6 +73,9 @@ const fridayPay = (trade_no) => req({url: "payments/welfare/wechat",method: "POS
|
|||||||
//洗车券-获取跳转地址
|
//洗车券-获取跳转地址
|
||||||
const washcarUrl = (welfare_id, right_config_id) => req({url: "washcar/infourl", data: {welfare_id: welfare_id, right_config_id: right_config_id}})
|
const washcarUrl = (welfare_id, right_config_id) => req({url: "washcar/infourl", data: {welfare_id: welfare_id, right_config_id: right_config_id}})
|
||||||
|
|
||||||
|
//洗车券-获取跳转地址
|
||||||
|
const washcarCoupon = (coupon) => req({url: "washcar/" + coupon + "/info",method: "POST"})
|
||||||
|
|
||||||
//首页轮播-跳转本页面 --业务数据查看
|
//首页轮播-跳转本页面 --业务数据查看
|
||||||
const busineSee = (business) => req({url: "business/" + business})
|
const busineSee = (business) => req({url: "business/" + business})
|
||||||
|
|
||||||
@@ -107,6 +110,7 @@ export default({
|
|||||||
fridayInfo,
|
fridayInfo,
|
||||||
fridayPay,
|
fridayPay,
|
||||||
washcarUrl,
|
washcarUrl,
|
||||||
|
washcarCoupon,
|
||||||
busineSee,
|
busineSee,
|
||||||
busineForm,
|
busineForm,
|
||||||
subscribe
|
subscribe
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ const unicom = (mobile, channel, code) => req({url: "unicom/get", method: "POST"
|
|||||||
// 获取商家券信息
|
// 获取商家券信息
|
||||||
const merchant_card = (coupon_id) => req({url: "coupons/merchant_card", method: "GET", data:{coupon_id : coupon_id}})
|
const merchant_card = (coupon_id) => req({url: "coupons/merchant_card", method: "GET", data:{coupon_id : coupon_id}})
|
||||||
|
|
||||||
|
// 获取商家券信息
|
||||||
|
const washcarBuy = () => req({url: "washcar/create"})
|
||||||
|
|
||||||
export default({
|
export default({
|
||||||
index,
|
index,
|
||||||
mobiles,
|
mobiles,
|
||||||
@@ -69,5 +72,6 @@ export default({
|
|||||||
ungrants,
|
ungrants,
|
||||||
send,
|
send,
|
||||||
unicom,
|
unicom,
|
||||||
merchant_card
|
merchant_card,
|
||||||
|
washcarBuy
|
||||||
})
|
})
|
||||||
|
|||||||
3
app.json
3
app.json
@@ -27,7 +27,8 @@
|
|||||||
"pages/welfare/welfare",
|
"pages/welfare/welfare",
|
||||||
"pages/classify/classify",
|
"pages/classify/classify",
|
||||||
"pages/washcar/washcar",
|
"pages/washcar/washcar",
|
||||||
"pages/makeForm/makeForm"
|
"pages/makeForm/makeForm",
|
||||||
|
"pages/car/index"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"backgroundTextStyle": "light",
|
"backgroundTextStyle": "light",
|
||||||
|
|||||||
37
pages/car/index.js
Normal file
37
pages/car/index.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* 本时生活
|
||||||
|
*/
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad (options) {
|
||||||
|
console.log(options)
|
||||||
|
// this.couponInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow () {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券列表
|
||||||
|
*/
|
||||||
|
couponInfo() {
|
||||||
|
wx.$api.user.washcarBuy().then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
3
pages/car/index.json
Normal file
3
pages/car/index.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
2
pages/car/index.wxml
Normal file
2
pages/car/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/car/index.wxml-->
|
||||||
|
<text>pages/car/index.wxml</text>
|
||||||
1
pages/car/index.wxss
Normal file
1
pages/car/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* pages/car/index.wxss */
|
||||||
@@ -92,5 +92,36 @@ Page({
|
|||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 优惠券跳转
|
||||||
|
couponUrl(e) {
|
||||||
|
let newFrom = e.currentTarget.dataset.from,
|
||||||
|
newId = e.currentTarget.dataset.id,
|
||||||
|
newStatus = e.currentTarget.dataset.status
|
||||||
|
if(newStatus == 0) {
|
||||||
|
if(newFrom == 'washcar') {
|
||||||
|
wx.$api.index.washcarCoupon(newId).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 : ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/couponDetails/couponDetails?id=' + newId
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -16,7 +16,8 @@
|
|||||||
<!-- 卡券列表 -->
|
<!-- 卡券列表 -->
|
||||||
<view class="coupon" wx:if="{{coupons != ''}}">
|
<view class="coupon" wx:if="{{coupons != ''}}">
|
||||||
<view class="couponCont {{item.status != 0 ? 'active' : ''}}" wx:for="{{coupons}}" wx:key="coupons">
|
<view class="couponCont {{item.status != 0 ? 'active' : ''}}" wx:for="{{coupons}}" wx:key="coupons">
|
||||||
<navigator hover-class="none" class="couponList" url="{{item.status == 0 ? '/pages/couponDetails/couponDetails?id=' + item.coupon_id : ''}}">
|
<!-- url="{{item.status == 0 ? '/pages/couponDetails/couponDetails?id=' + item.coupon_id : ''}}" -->
|
||||||
|
<view hover-class="none" class="couponList" bindtap="couponUrl" data-id="{{item.coupon_id }}" data-from="{{item.from }}" data-status="{{item.status}}">
|
||||||
<view class="couponList-left">
|
<view class="couponList-left">
|
||||||
<image class="couponList-img" src="/static/img/coupon_img.png"></image>
|
<image class="couponList-img" src="/static/img/coupon_img.png"></image>
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@
|
|||||||
|
|
||||||
<image wx:if="{{item.status == 1}}" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
|
<image wx:if="{{item.status == 1}}" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
|
||||||
<image wx:if="{{item.status == 2}}" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
|
<image wx:if="{{item.status == 2}}" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
|
||||||
</navigator>
|
</view>
|
||||||
<view class="couponMore" wx-if="{{item.count > 1}}" >
|
<view class="couponMore" wx-if="{{item.count > 1}}" >
|
||||||
<view class="couponMore-text" bindtap="couponTap" data-id="{{item.activityId}}" data-status="{{item.status}}">
|
<view class="couponMore-text" bindtap="couponTap" data-id="{{item.activityId}}" data-status="{{item.status}}">
|
||||||
<view class="couponMore-title">查看全部{{item.count}}张卡券</view>
|
<view class="couponMore-title">查看全部{{item.count}}张卡券</view>
|
||||||
|
|||||||
@@ -64,6 +64,37 @@ Page({
|
|||||||
pageNumber++
|
pageNumber++
|
||||||
this.couponInfo(pageNumber)
|
this.couponInfo(pageNumber)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 优惠券跳转
|
||||||
|
couponUrl(e) {
|
||||||
|
let newFrom = e.currentTarget.dataset.from,
|
||||||
|
newId = e.currentTarget.dataset.id,
|
||||||
|
newStatus = e.currentTarget.dataset.status
|
||||||
|
if(newStatus == 0) {
|
||||||
|
if(newFrom == 'washcar') {
|
||||||
|
wx.$api.index.washcarCoupon(newId).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 : ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/couponDetails/couponDetails?id=' + newId
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
<!-- 卡券列表 -->
|
<!-- 卡券列表 -->
|
||||||
<view class="coupon" wx:if="couponArr != ''">
|
<view class="coupon" wx:if="couponArr != ''">
|
||||||
<navigator class="couponCont {{item.status != 0 ? 'active' : ''}}" wx:for="{{couponArr}}" wx:key="couponArr" hover-class="none" url="{{item.status == 0 ? '/pages/couponDetails/couponDetails?id=' + item.id : ''}}">
|
<!-- url="{{item.status == 0 ? '/pages/couponDetails/couponDetails?id=' + item.id : ''}}" -->
|
||||||
|
<view class="couponCont {{item.status != 0 ? 'active' : ''}}" wx:for="{{couponArr}}" wx:key="couponArr" bindtap="couponUrl" data-id="{{item.id}}" data-from="{{item.from }}" data-status="{{item.status}}">
|
||||||
<view class="couponList">
|
<view class="couponList">
|
||||||
<view class="couponList-left">
|
<view class="couponList-left">
|
||||||
<image class="couponList-img" src="/static/img/coupon_img.png"></image>
|
<image class="couponList-img" src="/static/img/coupon_img.png"></image>
|
||||||
@@ -47,7 +48,7 @@
|
|||||||
<image class="couponMore-arrow" src="/static/icon/arrow_left.png"></image>
|
<image class="couponMore-arrow" src="/static/icon/arrow_left.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</navigator>
|
</view>
|
||||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||||
<block wx:if="{{page.has_more}}">
|
<block wx:if="{{page.has_more}}">
|
||||||
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
|
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
frozenInfo() {
|
frozenInfo() {
|
||||||
wx.$api.user.ungrants(this.data.type).then(res=>{
|
wx.$api.user.ungrants(this.data.type).then(res=>{
|
||||||
|
console.log(res.data)
|
||||||
this.setData({
|
this.setData({
|
||||||
frozenData: res.data
|
frozenData: res.data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
<image src="/static/icon/frozen_arrow.png"></image>
|
<image src="/static/icon/frozen_arrow.png"></image>
|
||||||
返回上一个权益
|
返回上一个权益
|
||||||
</view>
|
</view>
|
||||||
<view class="frozenArrow-right" wx:if="{{frozenData.length > 1}}">
|
<view class="frozenArrow-right" wx:if="{{current == 0 || frozenData[frozenData.length - 1] > 0}}">
|
||||||
<image src="/static/icon/frozen_arrow.png"></image>
|
<image src="/static/icon/frozen_arrow.png"></image>
|
||||||
查看下一个权益
|
查看下一个权益
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ Page({
|
|||||||
* 选择收货地址
|
* 选择收货地址
|
||||||
*/
|
*/
|
||||||
selectAddress(e){
|
selectAddress(e){
|
||||||
|
console.log(e)
|
||||||
let new_addressId = e.currentTarget.dataset.id,
|
let new_addressId = e.currentTarget.dataset.id,
|
||||||
addressId = this.data.address.id
|
addressId = this.data.address.id
|
||||||
if (new_addressId != addressId) {
|
if (new_addressId != addressId) {
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
regiList : res.data
|
regiList : res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(this.data.regiList)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -140,6 +142,7 @@ Page({
|
|||||||
* 选择市区返回
|
* 选择市区返回
|
||||||
*/
|
*/
|
||||||
regionOpt (e) {
|
regionOpt (e) {
|
||||||
|
console.log(e)
|
||||||
let area_name = e.currentTarget.dataset.city
|
let area_name = e.currentTarget.dataset.city
|
||||||
var pages = getCurrentPages();
|
var pages = getCurrentPages();
|
||||||
var prevPage = pages[pages.length - 2];
|
var prevPage = pages[pages.length - 2];
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
url : decodeURIComponent(options.url)
|
url : decodeURIComponent(options.url)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(this.data.url)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -114,6 +114,12 @@
|
|||||||
"pathName": "pages/switchcity/switchcity",
|
"pathName": "pages/switchcity/switchcity",
|
||||||
"query": "",
|
"query": "",
|
||||||
"scene": null
|
"scene": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pages/car/index",
|
||||||
|
"pathName": "pages/car/index",
|
||||||
|
"query": "",
|
||||||
|
"scene": null
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user