Compare commits

..

2 Commits

Author SHA1 Message Date
zhangmanman
b5c5316f8b [更新] 2021-06-29 14:15:41 +08:00
zhangmanman
fa6638c90b [本时生活小程序] 2021-06-28 09:14:06 +08:00
20 changed files with 158 additions and 10 deletions

View File

@@ -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 washcarCoupon = (coupon) => req({url: "washcar/" + coupon + "/info",method: "POST"})
//首页轮播-跳转本页面 --业务数据查看
const busineSee = (business) => req({url: "business/" + business})
@@ -107,6 +110,7 @@ export default({
fridayInfo,
fridayPay,
washcarUrl,
washcarCoupon,
busineSee,
busineForm,
subscribe

View File

@@ -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 washcarBuy = () => req({url: "washcar/create"})
export default({
index,
mobiles,
@@ -69,5 +72,6 @@ export default({
ungrants,
send,
unicom,
merchant_card
merchant_card,
washcarBuy
})

View File

@@ -7,7 +7,7 @@ import {updToken} from './updateToken'
// wx8e424dbdc443381f 测试appid
// wxb2e3e8091d9feac3 正式appid
const api = "https://card.ysd-bs.com/api/" //正式地址
const api = "https://lifetest.ysd-bs.com/api/" //正式地址
const header = {
"Accept" : "application/json"
}

View File

@@ -27,7 +27,8 @@
"pages/welfare/welfare",
"pages/classify/classify",
"pages/washcar/washcar",
"pages/makeForm/makeForm"
"pages/makeForm/makeForm",
"pages/car/index"
],
"window": {
"backgroundTextStyle": "light",

37
pages/car/index.js Normal file
View 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
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

2
pages/car/index.wxml Normal file
View File

@@ -0,0 +1,2 @@
<!--pages/car/index.wxml-->
<text>pages/car/index.wxml</text>

1
pages/car/index.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/car/index.wxss */

View File

@@ -92,5 +92,36 @@ Page({
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
})
}
}
})

View File

@@ -16,7 +16,8 @@
<!-- 卡券列表 -->
<view class="coupon" wx:if="{{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">
<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 == 2}}" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
</navigator>
</view>
<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-title">查看全部{{item.count}}张卡券</view>

View File

@@ -64,6 +64,37 @@ Page({
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
})
}
}
/**

View File

@@ -1,7 +1,8 @@
<!-- 卡券列表 -->
<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-left">
<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>
</view>
</view>
</navigator>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...

View File

@@ -33,6 +33,7 @@ Page({
*/
frozenInfo() {
wx.$api.user.ungrants(this.data.type).then(res=>{
console.log(res.data)
this.setData({
frozenData: res.data
})

View File

@@ -105,7 +105,7 @@
<image src="/static/icon/frozen_arrow.png"></image>
返回上一个权益
</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>
查看下一个权益
</view>

View File

@@ -219,6 +219,7 @@ Page({
* 选择收货地址
*/
selectAddress(e){
console.log(e)
let new_addressId = e.currentTarget.dataset.id,
addressId = this.data.address.id
if (new_addressId != addressId) {

View File

@@ -27,6 +27,7 @@ Page({
},
onLoad(e) {
console.log(e)
wx.getLocation({
success: res => {
// 解析坐标
@@ -132,6 +133,8 @@ Page({
this.setData({
regiList : res.data
})
console.log(this.data.regiList)
})
},
@@ -139,6 +142,7 @@ Page({
* 选择市区返回
*/
regionOpt (e) {
console.log(e)
let area_name = e.currentTarget.dataset.city
var pages = getCurrentPages();
var prevPage = pages[pages.length - 2];

View File

@@ -15,6 +15,8 @@ Page({
this.setData({
url : decodeURIComponent(options.url)
})
console.log(this.data.url)
},
/**

View File

@@ -23,7 +23,7 @@
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": false,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
@@ -40,7 +40,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.12.1",
"appid": "wxb2e3e8091d9feac3",
"appid": "wx8e424dbdc443381f",
"projectname": "%E4%BA%BF%E6%97%B6%E4%BB%A3%EF%BC%88%E6%B5%8B%E8%AF%95%EF%BC%89",
"debugOptions": {
"hidedInDevtools": []

View File

@@ -106,6 +106,19 @@
{
"name": "pages/makeForm/makeForm",
"pathName": "pages/makeForm/makeForm",
"query": "",
"scene": null
},
{
"name": "pages/switchcity/switchcity",
"pathName": "pages/switchcity/switchcity",
"query": "",
"scene": null
},
{
"name": "pages/car/index",
"pathName": "pages/car/index",
"query": "",
"scene": null
}
]

11
sh.exe.stackdump Normal file
View File

@@ -0,0 +1,11 @@
Stack trace:
Frame Function Args
00800000010 0018006392E (00180279F10, 0018026AFD1, 00800000010, 000FFFFBA00)
00800000010 0018004973A (00100002000, 000FFFFCBA0, 00180350478, 00000000002)
00800000010 00180049772 (00000000002, 00180350788, 00800000010, 00000000008)
00800000010 0018005CBDD (000FFFFCC9F, 000FFFFCBD0, 000FFFFCC74, 000FFFFCC9F)
000FFFFCBAC 0018005CD4F (745C695C675C2F5C, 7A5C755C795C2E5C, 6B5C6E5C615C685C, 2E5C695C6A5C655C)
000FFFFCCE0 00180049EE8 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 00180048846 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 001800488F4 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace