[本时生活H5]

This commit is contained in:
2023-09-28 14:35:28 +08:00
parent f74b177f6d
commit 69824dedea
48 changed files with 9224 additions and 6635 deletions

View File

@@ -66,6 +66,40 @@ const monthsChoose = (category_id) => {
})
}
// 月兑活动 - 领取红包
const monthsPacket = (data) => {
return request({
url : "months/red_packet",
data : data
})
}
// 月兑活动 - 可用商家列表
const shopsUrl = (coupon_id, data) => {
return request({
url : "washcar/" + coupon_id + "/shops",
data : data
})
}
// 入库用户微信信息
const authInfo = (data) => {
return request({
url : "auth/info",
method : "POST",
data : data
})
}
// h5微信支付获取微信授权地址
const getAuthUrl = (data) => {
return request({
url : 'auth/get_auth_url',
data: data
})
}
export {
index,
details,
@@ -74,5 +108,9 @@ export {
coupon,
logs,
monthsList,
monthsChoose
monthsChoose,
monthsPacket,
shopsUrl,
authInfo,
getAuthUrl
}

View File

@@ -62,6 +62,16 @@ const subscribeH5 = (subscribe, channel) => {
}
})
}
// 营业厅列表
const hallsIndex = (data) => {
return request({
url: "halls",
data: data
})
}
export {
activity,
index,
@@ -69,5 +79,6 @@ export {
newCity,
newidxCity,
subscribeUrl,
subscribeH5
subscribeH5,
hallsIndex
}

View File

@@ -96,6 +96,15 @@ const ungrants = (type) => {
})
}
// 冻结列表-最新
const ungrantsNew = (data) => {
return request({
url: 'account/unaccountgrants',
data: data
})
}
// 洗车券-获取跳转地址
const washcarCoupon = (coupon) => {
return request({
@@ -383,6 +392,7 @@ export {
profitsNext,
cards,
ungrants,
ungrantsNew,
washcarCoupon,
orders,
ordersCoupons,

View File

@@ -10,8 +10,8 @@ import store from '@/store'
// https://lifetest.ysd-bs.com //测试地址
// https://card.ysd-bs.com
const config = {
// apiUrl : 'https://lifetest.ysd-bs.com/api/',
apiUrl : 'https://card.ysd-bs.com/api/',
// apiUrl : 'https://lifetest.ysd-bs.com/api/', //测试地址
apiUrl : 'https://card.ysd-bs.com/api/', //正式地址
timeout: 60000
}

View File

@@ -14,7 +14,6 @@ Vue.prototype.$wx = require('jweixin-module')
App.mpType = 'app'
// jsonp
Vue.use(VueJsonp)

View File

@@ -18,27 +18,29 @@
},
/* */
"modules" : {
"Payment" : {}
"Payment" : {},
"Maps" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
@@ -53,7 +55,13 @@
"UniversalLinks" : ""
}
},
"ad" : {}
"ad" : {},
"maps" : {
"amap" : {
"appkey_ios" : "73f1992898e143896d4529a8ffead6c3",
"appkey_android" : "73f1992898e143896d4529a8ffead6c3"
}
}
}
}
},

70
package-lock.json generated
View File

@@ -1,69 +1,35 @@
{
"name": "ysdH5",
"lockfileVersion": 3,
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"encoding": {
"version": "0.1.13",
"resolved": "https://registry.npmmirror.com/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"requires": {
"iconv-lite": "^0.6.2"
"packages": {
"": {
"dependencies": {
"@vuemap/amap-jsapi-loader": "^1.0.3",
"jweixin-module": "^1.6.0",
"vue-jsonp": "^2.0.0",
"weixin-js-sdk": "^1.6.0"
}
},
"iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
"node_modules/@vuemap/amap-jsapi-loader": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/@vuemap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.3.tgz",
"integrity": "sha512-GdRWm7IAto18TJLySjm8JehNPlvYW8cNaqqnb1CQHvpr7k3zkGdvCrv+7H/Op1HaLMCt4LQsUjEAkiAqUfqZ7A=="
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ=="
},
"jweixin-module": {
"node_modules/jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-1.7.3.tgz",
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
"requires": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"vue-jsonp": {
"node_modules/vue-jsonp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
"resolved": "https://registry.npmmirror.com/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
"integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA=="
},
"weixin-js-sdk": {
"node_modules/weixin-js-sdk": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz",
"integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ=="
},
"wxjssdk": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/wxjssdk/-/wxjssdk-1.0.1.tgz",
"integrity": "sha512-tY69YisKIiG6jT0cnTIwTvK4I6ivF8iWXyq5tmgVULiyKPRAWRDEIwhWUdHi7NljN9PQeLOZudUaiIq4gGfefA==",
"requires": {
"node-fetch": "^1.6.3"
}
},
"wxjssdk-copy": {
"version": "1.4.1",
"resolved": "https://registry.npmmirror.com/wxjssdk-copy/-/wxjssdk-copy-1.4.1.tgz",
"integrity": "sha512-wTLfNrT7vIzsO4/YdalRCvErq/wD7pST1TOvWnOf00LvGHwqPcrm4ka3pYP0sI6sXDgfJh4HbjIcPgQTb20Gcg=="
}
}
}

8
package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"dependencies": {
"@vuemap/amap-jsapi-loader": "^1.0.3",
"jweixin-module": "^1.6.0",
"vue-jsonp": "^2.0.0",
"weixin-js-sdk": "^1.6.0"
}
}

View File

@@ -10,7 +10,7 @@
},{
"path": "pages/giftPack/index",
"style": {
"navigationBarTitleText": "超级红包活动",
"navigationBarTitleText": "联通合约送全额消费金",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
@@ -64,10 +64,22 @@
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/superRed",
"style" : {
"navigationBarTitleText": "领取消费金",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/logsFrozen",
"style" : {
"navigationBarTitleText": "待发放",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/logs",
"style" : {
"navigationBarTitleText": "积分记录",
"navigationBarTitleText": "余额明细记录",
"enablePullDownRefresh": false
}
},{
@@ -417,7 +429,7 @@
},{
"path": "pages/campus/index",
"style": {
"navigationBarTitleText": "校园迎新活动",
"navigationBarTitleText": "消费金兑换活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
@@ -445,7 +457,7 @@
},{
"path": "pages/campus/signin",
"style": {
"navigationBarTitleText": "校园迎新活动 登录",
"navigationBarTitleText": "消费金兑换活动登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
@@ -488,6 +500,12 @@
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/campus/campusPay",
"style" : {
"navigationBarTitleText": "收银台",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userGoods/index",
"style" : {
@@ -710,6 +728,12 @@
"navigationBarTitleText": "兑换成功",
"enablePullDownRefresh": false
}
},{
"path" : "pages/business/business",
"style" : {
"navigationBarTitleText": "附近营业厅",
"enablePullDownRefresh": false
}
}
],
"tabBar": {

View File

@@ -106,7 +106,12 @@
_this.disabled = true
}
}, 1000)
}).catch(err=>{})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
},

273
pages/business/business.vue Normal file
View File

@@ -0,0 +1,273 @@
<template>
<view>
<view class="pack-center pages-hint showActive" v-if="showDt">
<image src="/static/img/null_icon.png"></image>
<view>查看附近营业厅需要获取您的地理位置</view>
<!-- <button class="location-btn" size="mini" open-type="openSetting">
开启定位服务
</button> -->
<view class="showActive-go" @tap="showTap">获取</view>
</view>
<view class="showDt" v-else>
<view class="top">
<view class="top-left nowrap">{{locationData.address}}</view>
<view class="top-picker">
<picker @change="screenOrders" :value="ordersIndex" :range-key="'name'" :range="ordersWay">
{{ ordersWay[ordersIndex].name }}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view class="list" v-if="cityList.length > 0">
<view class="item" v-for="(item, index) in cityList" :key="index">
<image :src="item.cover" mode="aspectFill" class="item-logo"></image>
<view class="item-cont">
<view class="item-name nowrap">{{item.title}}</view>
<view class="item-address nowrap">{{item.address}}</view>
<view class="item-distance nowrap">
<view class="item-distance-left">{{item.distance}}</view>
<view class="item-distance-go" @tap="siteMap(item.latitude, item.longitude)">去导航</view>
</view>
</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</view>
</template>
<script>
import { hallsIndex } from '@/apis/interfaces/index'
import QQMapWX from '@/utils/qqmap-wx-jssdk.min.js'
export default {
data() {
return {
showDt : false,
latitude : '',
longitude : '',
Distance : '',
locationData : '',
cityList : [], // 营业厅列表
qqMap: new QQMapWX({
key: '4KYBZ-LCAKF-QWOJN-NIDNZ-FZHLZ-2XFW7',
vm: this
}),
ordersIndex : 0,
ordersWay : [
{value: '', name: "全部"},
{value: '1000', name: "小于1000"},
{value: '2000', name: "小于2000"}
],
page : 1, //分页
lodingStats : false //加载状态
}
},
onLoad(e) {
if(this.latitude == '') {
this.showDt = true
}
},
onShow() {},
methods:{
showTap() {
this.showDt = false
// 获取定位 - 使用腾讯地图sdk
uni.getLocation({
success: res => {
// 调用接口
this.qqMap.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: locatRes => {
this.latitude = locatRes.result.location.lat
this.longitude = locatRes.result.location.lng
// 获取营业厅列表
this.regilist(this.latitude, this.longitude);
},
fail: res => {},
complete: res => {}
});
}
})
},
// 营业厅列表
regilist(page) {
hallsIndex({
user_lat: this.latitude,
user_lng: this.longitude,
distance: this.Distance,
page : page || ''
}).then(res=>{
let newStores = this.cityList,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.halls.data)
for(let val in res.halls.data){
let distance = res.halls.data[val].distance
if (distance > 1000) {
distance = parseFloat( distance / 1000).toFixed(2) + "km";
} else {
distance = parseFloat( distance).toFixed(2) + "m";
}
res.halls.data[val].distance = distance
}
this.cityList = newData
this.locationData = res.location
this.page = res.halls.page
this.lodingStats = false
uni.stopPullDownRefresh()
})
},
screenOrders(e) {
this.ordersIndex = e.detail.value
this.Distance = Number(this.ordersWay[this.ordersIndex].value)
// 营业厅列表
this.regilist();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 营业厅列表
this.regilist();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 营业厅列表
this.regilist(pageNumber);
}
},
// 导航
siteMap(lat, long){
let key = '34ea3d2958aee3ffc154738551a976f9',//高德地图key
latitude = parseFloat(lat),
longitude = parseFloat(long)
window.location.href = "http://uri.amap.com/marker?position="+ longitude +","+latitude +"&name="+ name +"&coordinate=gaode&callnative=1";
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f0f4fe;
}
.showActive {
z-index: 1;
}
.showActive-go {
display: inline-block;
background-color: #666c9f;
color: #ffffff;
border-radius: 10rpx;
height: 64rpx;
line-height: 64rpx;
padding: 0 60rpx;
font-size: 28rpx;
margin-top: 30rpx;
}
.top {
padding: 30rpx;
box-sizing: border-box;
display: flex;
}
.top-left {
flex: 1;
margin-right: 30rpx;
line-height: 64rpx;
}
.top-picker {
display: flex;
background-color: #ffffff;
line-height: 64rpx;
padding: 0 20rpx;
box-sizing: border-box;
border-radius: 10rpx;
}
.profigReport-module-picker {
display: flex;
color: #797979;
font-size: 28rpx;
}
.profigReport-module-icon {
width: 28rpx;
height: 28rpx;
margin: 20rpx 0 0 10rpx;
}
.list {
padding: 0 30rpx 30rpx;
box-sizing: border-box;
}
.item {
background-color: #ffffff;
padding: 30rpx;
box-sizing: border-box;
border-radius: 10rpx;
margin-bottom: 30rpx;
position: relative;
}
.item-logo {
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
.item-cont {
width: 100%;
position: absolute;
left: 0;
top: 0;
padding: 30rpx 30rpx 30rpx 240rpx;
box-sizing: border-box;
}
.item-name {
font-weight: 600;
font-size: 34rpx;
}
.item-address {
margin: 10rpx 0 30rpx;
}
.item-distance {
display: flex;
}
.item-distance-left {
flex: 1;
line-height: 58rpx;
}
.item-distance-go {
background-color: #666c9f;
color: #ffffff;
border-radius: 10rpx;
height: 58rpx;
line-height: 58rpx;
padding: 0 20rpx;
font-size: 26rpx;
}
</style>

View File

@@ -165,7 +165,6 @@
// 详情
rightsInfo() {
buy({activity_school_id: this.rightData.rightId, qty: this.rightData.num}).then(res => {
console.log(res)
let obj = res.detail.express
let arr = new Array
arr = Object.keys(obj).map(val=>{
@@ -233,28 +232,27 @@
// 收银台跳转
payment() {
if(this.buyWay.isdeliver.length == 0) this.buyWay.isdeliver = this.rightData.detail.def_get
uni.showModal({
title: '购买提示',
content: '确认购买此权益吗',
success: res => {
if (res.confirm) {
if(this.buyWay.isdeliver.length == 0) this.buyWay.isdeliver = this.rightData.detail.def_get
buySubmit({activity_school_id: this.rightData.rightId, qty: this.rightData.num, is_deliver: this.buyWay.isdeliver}).then(res => {
uni.navigateTo({
url: '/pages/cashier/index?tradeNo=' + res.trade_no + '&type=school' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
});
buySubmit({activity_school_id: this.rightData.rightId, qty: this.rightData.num, is_deliver: this.buyWay.isdeliver}).then(res => {
uni.navigateTo({
url: '/pages/campus/campusPay?tradeNo=' + res.trade_no + '&type=school' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
}).catch(err => {
console.log(err)
uni.showToast({
title : err.message,
icon : 'none'
})
});
}
}
});
}
}

692
pages/campus/campusPay.vue Normal file
View File

@@ -0,0 +1,692 @@
<template>
<view>
<view class="cashierTips">
<image src="/static/img/cashierTips_icon.png" mode="aspectFill"></image>推荐使用沃支付可在享优惠
</view>
<view class="cashierCont">
<view class="cashierCont-title">
<text>支付类型</text>线上支付
</view>
<view class="cashierCont-price">
<block v-if="this.defaultType == 'unicom'">
<view class="cashierCont-price-title">
中奖用户0元支付
</view>
<view class="cashierCont-price-title">
具体支付金额以页面显示为准
</view>
</block>
<block v-else>
<view class="cashierCont-price-title">
付款金额
</view>
<view class="cashierCont-price-number">
{{ defaultPrice }}
</view>
</block>
</view>
<view class="cashierCont-pay">
<view class="cashierCont-pay-title">
付款方式<text>*</text>
</view>
<view class="cashierCont-pay-way">
<radio-group @change="radioChange">
<view class="cashierCont-way-label cashierCont-way-unicom" :class="{active : current == 1}">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wqb.jpg"></image>
<text>沃支付支付</text>
</view>
<radio class="radio" value="1" checked></radio>
</view>
</radio-group>
</view>
<button class="payBtn" @tap="submitPay" :disabled="disabledOk">立即支付</button>
</view>
</view>
</view>
</template>
<script>
import { getAuthUrl, wpayH5Info, h5Pay } from '@/apis/interfaces/rights'
const jweixin = require('jweixin-module'); //获取微信支付
export default {
data() {
return {
defaultPrice : '', //支付金额
disabledOk : false, //支付按钮状态
current : 1, //支付下标
defaultNo : '', //权益订单编号
defaultType : '', //购买类型 school为校园活动 oil为中石油活动 default为洗车券+权益+周五福利 giftPEnv为月兑活动
activityType : '', //活动类型 welfare为周五福利日 right为权益
defaultDeliver : '' //提交方式 0为快递 1为自提
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 判断是否微信授权登录过 只有外部游览器才用到(支付需要授权微信环境)
let status = navigator.userAgent.toLowerCase();
if (status.match(/MicroMessenger/i) == "micromessenger" && !options.code) {
let locationUrl = window.location.pathname.substr(1) + window.location.search
getAuthUrl(locationUrl).then(res=> {
window.location.href = res
})
}
this.openid = options.openid || ''
this.code = options.code || '' //用code换取oppid
// 页面跳转参数接收
this.defaultPrice = options.price
this.defaultNo = options.tradeNo
this.defaultType = options.type
this.activityType = options.activity_type
this.defaultDeliver = options.deliver
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
},
methods: {
// 支付方式选择
radioChange(e) {
this.current = e.detail.value
},
// 支付提交
submitPay() {
// this.current为1的时候为沃支付-直接跳转h5
if (this.current == 1) {
// const newUrl = "https://lifetest.ysd-bs.com/webunicom/payment?trade_no=" + this.defaultNo // 测试地址
const newUrl = "https://card.ysd-bs.com/webunicom/payment?trade_no=" + this.defaultNo // 正式地址
window.location.href = newUrl
}
// this.current为1的时候为微信支付
if (this.current == 2) {
// 调取微信支付
this.wechatPayment();
}
},
// 微信支付数据
wechatPayment() {
let status = navigator.userAgent.toLowerCase();
if (status.match(/MicroMessenger/i) == "micromessenger") {
// 微信浏览器-获取
this.wxBrowser();
}else {
// 普通浏览器(网址游览器)
this.outBrowser();
}
},
// 当支付环境为微信游览器情况下
wxBrowser() {
wpayH5Info({
url: location.href.split('#')[0],
list:'chooseWXPay'
}).then(wechatConfig => {
let wxConfig = JSON.parse(wechatConfig)
jweixin.config({
appId: wxConfig.appId,
debug: false,
jsApiList: wxConfig.jsApiList,
signature: wxConfig.signature,
nonceStr: wxConfig.nonceStr,
timestamp: wxConfig.timestamp
})
jweixin.ready(() => {
// activityType=right为权益 支付; activityType=welfare为周五福利日 支付
let wechaUrl = '' // 定义接口来源名称
if (this.activityType == 'welfare') wechaUrl = 'payments/welfare/wechat'// 周五福利日支付接口
if (this.activityType == 'right') wechaUrl = 'payments/wechat' //权益支付接口
h5Pay(wechaUrl, {
channel: 'h5',
trade_no: this.defaultNo,
code: this.code
}).then(wechatRes => {
let wechatPay = JSON.parse(wechatRes)
jweixin.chooseWXPay({
timestamp: wechatPay.timeStamp,
nonceStr: wechatPay.nonceStr,
package: wechatPay.package,
signType: wechatPay.signType,
paySign: wechatPay.paySign,
success: payRes => {
this.disabledOk = true
uni.showToast({
title: '支付成功',
icon : 'success'
})
// 校园活动成功跳转
if(this.defaultType == 'school') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/campus/myCoupon'
})
},3000)
}
// 中石油活动活动成功跳转
if(this.defaultType == 'oil') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/oil/myCoupon'
})
},3000)
}
// 中国联通回馈活动成功跳转
if(this.defaultType == 'unicom') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/unicom/index'
})
},3000)
}
// 月兑活动成功跳转
if(this.defaultType == 'giftPEnv') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/giftPack/index'
})
},3000)
}
// 洗车券+权益+福利成功跳转 获取
if(this.defaultType == 'default') {
this.successUrl();
}
},
cancel: () =>{
this.disabledOk = true
uni.showToast({
title: '取消支付',
icon : 'success'
})
// 校园活动失败跳转
if(this.defaultType == 'school') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/campus/index'
})
},3000)
}
// 中石油活动活动成功跳转
if(this.defaultType == 'oil') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/oil/index'
})
},3000)
}
// 月兑活动成功跳转
if(this.defaultType == 'giftPEnv') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/giftPack/index'
})
},3000)
}
// 中国联通回馈活动成功跳转
if(this.defaultType == 'unicom') {
setTimeout(()=>{
uni.reLaunch({
url: '/pages/unicom/index'
})
},3000)
}
// 洗车券+权益+福利失败跳转 获取
if(this.defaultType == 'default') {
this.failUrl();
}
}
})
})
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
if (!err.login) {
// 跳转校园活动登录页面
if (this.defaultType == 'school') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/campus/signin'
});
}
}
})
}
// 跳转中石油活动登录页面
if (this.defaultType == 'oil') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/oil/signin'
});
}
}
})
}
// 月兑活动成功跳转
if(this.defaultType == 'giftPEnv') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/giftPack/signin'
});
}
}
})
}
// 中国联通回馈活动成功跳转
if (this.defaultType == 'unicom') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/unicom/signin'
});
}
}
})
}
// 跳转本时生活平台登录页面
if (this.defaultType == 'default') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/auth/login'
});
}
}
})
}
}
})
},
// 车券+权益+福利成功跳转 数据
successUrl() {
if(this.activityType == 'welfare'){
setTimeout(()=>{
if(this.defaultDeliver == 1) {
uni.reLaunch({
url: '/pages/order/order?orderType=welfareGoods'
})
} else {
uni.reLaunch({
url: '/pages/order/order?orderType=welfare'
})
}
},3000)
}
if(this.activityType == 'right'){
setTimeout(()=>{
if(this.defaultDeliver == 1) {
uni.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons'
})
} else {
uni.reLaunch({
url: '/pages/order/order?orderType=rights'
})
}
},3000)
}
},
// 车券+权益+福利失败跳转 数据
failUrl() {
if(this.activityType == 'welfare'){
setTimeout(()=>{
if(this.defaultDeliver == 1) {
uni.reLaunch({
url: '/pages/order/order?orderType=welfareGoods&stateType=unpay'
})
} else {
uni.reLaunch({
url: '/pages/order/order?orderType=welfare&stateType=unpay'
})
}
},3000)
}
if(this.activityType == 'right'){
setTimeout(()=>{
if(this.defaultDeliver == 1) {
uni.reLaunch({
url: '/pages/order/order?orderType=rightsCoupons&stateType=unpay'
})
} else {
uni.reLaunch({
url: '/pages/order/order?orderType=rights&stateType=unpay'
})
}
},3000)
}
},
// 当为外部游览器环境
outBrowser(){
wechatH5({
channel: 'mweb',
trade_no: this.defaultNo
}).then(mwebRes => {
let url = mwebRes
let newUrl = ''
// 校园活动购买
if(this.defaultType == 'school') {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/campus/myCoupon'
// #ifdef H5
window.location.href = newUrl
// #endif
}
// 中石油活动购买
if(this.defaultType == 'oil') {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/oil/myCoupon'
// #ifdef H5
window.location.href = newUrl
// #endif
}
// 月兑活动成功跳转
if(this.defaultType == 'giftPEnv') {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/giftPack/myCoupon'
// #ifdef H5
window.location.href = newUrl
// #endif
}
// 中国联通回馈活动购买
if(this.defaultType == 'unicom') {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/unicom/index'
// #ifdef H5
window.location.href = newUrl
// #endif
}
// 洗车券+权益+福利购买
if(this.defaultType == 'default') {
if (this.activityType == 'welfare') {
if (this.defaultDeliver == 1) {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/order/order?orderType=welfareGoods'
// #ifdef H5
window.location.href = newUrl
// #endif
} else {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/order/order?orderType=welfare'
// #ifdef H5
window.location.href = newUrl
// #endif
}
}
if (this.activityType == 'right') {
if (this.defaultDeliver == 1) {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/order/order?orderType=rightsCoupons'
// #ifdef H5
window.location.href = newUrl
// #endif
} else {
newUrl = url + '&redirect_url=' + window.location.protocol + '//' + window.location.host + '/pages/order/order?orderType=rights'
// #ifdef H5
window.location.href = newUrl
// #endif
}
}
}
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
// 跳转校园活动登录页面
if (this.defaultType == 'school') {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
})
}
}
// 跳转中石油活动登录页面
if (this.defaultType == 'oil') {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
})
}
}
// 月兑活动成功跳转
if(this.defaultType == 'giftPEnv') {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/giftPack/signin'
});
}
}
})
}
// 中国联通回馈活动登录页面
if (this.defaultType == 'unicom') {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/unicom/signin'
});
}
}
})
}
}
// 跳转本时生活平台登录页面
if (this.defaultType == 'default') {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/auth/login'
});
}
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #bc1d30;
padding: 40rpx;
box-sizing: border-box;
}
.cashierTips {
background-color: #FFFFFF;
font-weight: 600;
font-size: 30rpx;
border-radius: 10rpx;
margin-bottom: 40rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
color: #e69500;
display: flex;
image {
width: 32rpx;
height: 32rpx;
margin: 24rpx 10rpx 0 0;
}
}
.cashierCont {
width: 100%;
background-color: #ffffff;
padding: 30rpx;
box-sizing: border-box;
border-radius: 20rpx;
overflow: hidden;
}
.cashierCont-title text {
color: #7e7d81;
padding-right: 30rpx;
}
.cashierCont-price {
text-align: center;
margin: 90rpx 0;
color: #bc1d30;
}
.cashierCont-price-title {
font-size: 34rpx;
margin-bottom: 10rpx;
}
.cashierCont-price-number {
font-size: 60rpx;
}
.cashierCont-pay-title {
color: #7e7d81;
margin-bottom: 40rpx;
text{
color: #bc1d30;
padding-left: 10rpx;
}
}
.cashierCont-pay-way {
height: 240rpx;
}
.cashierCont-way-label {
float: left;
border: 2rpx solid #e8e8e8;
box-sizing: border-box;
padding: 30rpx 0;
border-radius: 10rpx;
width: calc(50% - 84rpx);
text-align: center;
margin: 0 40rpx;
font-size: 30rpx;
position: relative;
&.active {
border-color: #bc1d30;
color: #bc1d30;
box-shadow: 0 10rpx 20rpx rgba(188, 29, 48 ,.3);
}
radio {
opacity: 0;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
image {
width: 90rpx;
height: 90rpx;
display: block;
margin: 0 auto 20rpx;
}
}
.cashierCont-way-unicom {
width: calc(100% - 84rpx);
}
.payBtn {
background-color: #bc1d30;
color: #ffffff;
height: 90rpx;
line-height: 90rpx;
width: 100%;
font-size: 32rpx;
padding: 0;
border-radius: 80rpx;
margin: 80rpx 0 40rpx;
}
.payBtn[disabled] {
background: #eaeaea !important;
}
</style>

View File

@@ -100,9 +100,8 @@
<image src="/static/img/campus_details_back.png" mode="aspectFill"></image>
<view class="detailsBottom-cont">
<view class="detailsBottom-title">
校园迎新活动
消费金兑换活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>

View File

@@ -1,109 +1,133 @@
<template>
<view>
<image class="campusBanner" src="/static/img/campusIdx_back.png" mode="widthFix"></image>
<view class="recommend">
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="recommend-label" v-for="(item, index) in topData" :key="index">
<view class="recommend-label-img">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="nowrap recommend-label-text">
{{ item.title }}<text>{{ item.name }}</text>
</view>
</navigator>
</view>
<!-- <image class="campusBanner" src="/static/img/campusIdx_back.png" mode="widthFix"></image> -->
<view class="bottomTop">
<!-- 卡片轮播 -->
<view class="indexBanner">
<view class="banner">
<swiper class="banner-swiper" interval="5000" autoplay indicator-dots>
<swiper-item >
<image class="banner-img" src="https://lifetest.ysd-bs.com/storage/materials/2023/09/20/微信图片_20230919170443.jpg"></image>
</swiper-item>
<swiper-item >
<image class="banner-img" src="https://lifetest.ysd-bs.com/storage/materials/2023/09/20/微信图片_20230919170449.jpg"></image>
</swiper-item>
<swiper-item >
<image class="banner-img" src="https://lifetest.ysd-bs.com/storage/materials/2023/09/19/微信图片_20230919170456.jpg"></image>
</swiper-item>
</swiper>
</view>
</view>
<!-- 电影券 -->
<view class="film">
<view class="filmTitle">
电影院优惠券
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in filmData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
</view>
<view class="recommend">
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="recommend-label" v-for="(item, index) in topData" :key="index">
<view class="recommend-label-img">
<image :src="item.cover" mode="aspectFill"></image>
</view>
<view class="nowrap recommend-label-text">
{{ item.title }}<text>{{ item.name }}</text>
</view>
</navigator>
</view>
<!-- 洗浴优惠券 -->
<view class="film">
<view class="filmTitle">
洗浴优惠券
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in bathData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
<!-- 39元套餐包年兑换480元消费金 -->
<view class="film">
<view class="filmTitle">
39元套餐包年兑换480元消费金
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in filmData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
</view>
<!-- 超市券 -->
<view class="film">
<view class="filmTitle">
超市券
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in marketData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
<!-- 59元套餐包年兑换720元消费金 -->
<view class="film">
<view class="filmTitle">
59元套餐包年兑换720元消费金
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in bathData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
</view>
<!-- 餐饮优惠券 -->
<view class="film">
<view class="filmTitle">
餐饮优惠券
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in repastData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
<!-- 云盘套餐包年兑换180元消费金 -->
<view class="film">
<view class="filmTitle">
云盘套餐包年兑换180元消费金
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in marketData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
</view>
<!-- 99元套餐包年兑换960元消费金 -->
<view class="film">
<view class="filmTitle">
99元套餐包年兑换960元消费金
</view>
<navigator hover-class="none" :url="'/pages/campus/buy?id=' + item.activity_school_id" class="filmList" v-for="(item, index) in repastData" :key="index">
<view class="filmList-top">
<view class="filmList-top-name">
{{ item.three_title || '-' }}<text>{{ item.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view class="filmList-tag" v-if="item.label != null">{{item.label || '-'}}</view>
<view v-if="item.button_text != null">
<view v-for="(btnItem, btnIndex) in item.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(items, index) in item.description" :key="index">
<text>{{ items }}</text>
</view>
</navigator>
</view>
</view>
<!-- 按钮 -->
<!-- 按钮 -->
<view class="campusBtn">
<view class="campusBtn-go" @click="userNav('/pages/giftPack/superRed')">
领取消费金
</view>
</view>
</view>
</template>
@@ -187,10 +211,36 @@
width: 100%;
}
.indexBanner {
padding: 30rpx;
box-sizing: border-box;
}
.banner {
position: relative;
padding-top: 48%;
width: 100%;
background: white;
overflow: hidden;
z-index: 99;
border-radius: 10rpx;
.banner-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.banner-img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
// 推荐
.recommend {
overflow: hidden;
overflow: hidden;
padding: 0 30rpx;
box-sizing: border-box;
.recommend-label {
@@ -306,18 +356,30 @@
}
}
// 按钮
.bottomTop {
border-bottom: 80rpx solid transparent;
}
// 按钮
.campusBtn {
background: linear-gradient(to right, #474d73, #28314e);
box-shadow: 0px 6px 10px rgba(188,152,90,.5);
border-radius: 60rpx;
line-height: 90rpx;
height: 90rpx;
margin: 30rpx 60rpx 0;
text-align: center;
color: #FFFFFF;
text {
color: #bd9045;
.campusBtn {
position: fixed;
width: 100%;
z-index: 9;
bottom: 0;
left: 0;
padding:30rpx;
box-sizing: border-box;
background-color: #cbaf7f;
.campusBtn-go {
font-size: 36rpx;
text-align: center;
font-weight: 600;
line-height: 100rpx;
height: 100rpx;
color: #FFFFFF;
border-radius: 60rpx;
width: 100%;
background: linear-gradient(to right, #474d73, #28314e);
box-shadow: 0px 6px 10px rgba(188,152,90,.5);
}
}

View File

@@ -2,7 +2,7 @@
<view>
<image class="campusCoupon" src="/static/img/campusCoupon_img.png" mode="widthFix"></image>
<view class="user">
<image src="/static/img/campusCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加校园迎新活动
<image src="/static/img/campusCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加联通平台优惠活动
</view>
<!-- 我的卡券 -->
<view class="borderContent">
@@ -76,13 +76,12 @@
</view>
<!-- 漂浮窗 -->
<view class="indexFloat" @click="followBtn">
<!-- <view class="indexFloat" @click="followBtn">
<image src="/static/img/subscribe.png" mode="aspectFill" class="indexFloat-animation"></image>
<view class="indexFloat-text">
<!-- <text>可查看大图</text> -->
<text>关注公众号</text>
</view>
</view>
</view> -->
<!-- 关注公众号弹出 -->
<view class="followBack" :class="{active : followState}"></view>

View File

@@ -5,7 +5,7 @@
<image src="/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">身份验证</view>
</view>
<image class="cover" src="/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
<image class="cover" src="/static/img/campus_nologo.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">

View File

@@ -5,7 +5,7 @@
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">用户注册</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
<image class="cover" src="@/static/img/campus_nologo.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="submitRegister">

View File

@@ -5,7 +5,7 @@
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">设置新密码</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
<image class="cover" src="@/static/img/campus_nologo.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">

View File

@@ -3,9 +3,9 @@
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">中石油活动登录</view>
<view class="title">消费金兑换活动登录</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
<image class="cover" src="@/static/img/campus_nologo.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
@@ -43,7 +43,7 @@
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
passwordLogin: false, // 登录方式
passwordLogin: true, // 登录方式
disabled : false,
}
},

View File

@@ -269,32 +269,41 @@
// 收银台跳转
judgeGeneral(){
if(this.buyWay.isdeliver.length == 0) this.buyWay.isdeliver = this.rightData.detail.def_get
uni.showModal({
title: '购买提示',
content: '确认购买此权益吗',
success: res => {
if (res.confirm) {
if(this.buyWay.isdeliver.length == 0) this.buyWay.isdeliver = this.rightData.detail.def_get
buySubmit({activity_month_id: this.rightData.rightId, qty: this.rightData.num, is_deliver: this.buyWay.isdeliver}).then(res => {
if(res.can_pay) {
uni.navigateTo({
url: '/pages/cashier/index?tradeNo=' + res.trade_no + '&type=giftPEnv' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
return
}
buySubmit({activity_month_id: this.rightData.rightId, qty: this.rightData.num, is_deliver: this.buyWay.isdeliver}).then(res => {
if(res.can_pay) {
uni.navigateTo({
url: '/pages/cashier/index?tradeNo=' + res.trade_no + '&type=giftPEnv' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
return
}
uni.showToast({
title : '购买成功',
icon : 'none'
})
setTimeout(()=>{
uni.reLaunch({
url: '/pages/giftPack/index'
})
},3000)
uni.showToast({
title : '购买成功',
icon : 'none'
})
setTimeout(()=>{
uni.reLaunch({
url: '/pages/giftPack/index'
})
},3000)
}).catch(err => {
uni.showToast({
title : err.message,
icon : 'none'
})
}).catch(err => {
uni.showToast({
title : err.message,
icon : 'none'
})
});
}
}
});
},
}
}

View File

@@ -48,41 +48,31 @@
<image src="/static/icon/arrow_left.png"></image>
</navigator>
</view>
<view class="location" v-if="longitude == 0 && latitude == 0">
<image class="location-img" src="/static/img/location_img.jpg"></image>
<text>您尚未授权本时生活开启定位服务</text>
<text>不能看到附近的商家哦点击下方按钮开启</text>
<button class="location-btn" size="mini" open-type="openSetting">
开启定位服务
</button>
</view>
<view v-else>
<block v-if="stores.length > 0">
<view class="detailsStore-list" :data-id="(item.store_id)" v-for="(item, index) in stores" :key="index"
@tap="detailsTap">
<image :src="item.cover" class="detailsStore-logo"></image>
<view class="detailsStore-cont">
<view class="detailsStore-left">
<view class="nowrap detailsStore-name">
{{ item.title }}
</view>
<view class="detailsStore-place">
<text class="nowrap">{{ item.address }}</text>
{{ item.km }}
</view>
</view>
<image class="detailsStore-tel" src="/static/icon/tel.png" @tap.stop="tel"
:data-tel="(item.mobile)"></image>
</view>
</view>
</block>
<block v-else>
<view class="pages-hint">
<image src="/static/img/null_icon.png"></image>
<view>暂无门店</view>
</view>
</block>
</view>
<block v-if="stores.length > 0">
<view class="detailsStore-list" :data-id="(item.store_id)" v-for="(item, index) in stores" :key="index"
@tap="detailsTap">
<image :src="item.cover" class="detailsStore-logo"></image>
<view class="detailsStore-cont">
<view class="detailsStore-left">
<view class="nowrap detailsStore-name">
{{ item.title }}
</view>
<view class="detailsStore-place">
<text class="nowrap">{{ item.address }}</text>
{{ item.km }}
</view>
</view>
<image class="detailsStore-tel" src="/static/icon/tel.png" @tap.stop="tel"
:data-tel="(item.mobile)"></image>
</view>
</view>
</block>
<block v-else>
<view class="pages-hint">
<image src="/static/img/null_icon.png"></image>
<view>暂无门店</view>
</view>
</block>
</view>
</view>
<!-- 使用须知 -->
@@ -113,7 +103,6 @@
<view class="detailsBottom-title">
超级红包活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>
@@ -184,6 +173,8 @@
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
// 获取定位信息
uni.getLocation({
success: res => {
@@ -204,7 +195,6 @@
user_lng: this.longitude,
user_lat: this.latitude
}).then(res=>{
console.log(res)
let stores = res.stores
stores.map(res=>{
let distance = res.distance

View File

@@ -1,10 +1,19 @@
<template>
<view class="content">
<view class="content-border">
<view v-for="(item, idx) in adverts" :key="item.cover">
<image class="campusBanner" :src="item.cover" mode="widthFix"></image>
</view>
<view class="recommend"></view>
<!-- 卡片轮播 -->
<view class="indexBanner">
<view class="banner">
<swiper class="banner-swiper" interval="5000" autoplay indicator-dots>
<swiper-item v-for="(item, idx) in adverts" :key="item.cover">
<image class="banner-img" :src="item.cover"></image>
</swiper-item>
</swiper>
</view>
</view>
<!-- <view class="recommend"></view> -->
<!-- tab -->
<view class="indexTab">
<view class="indexTab-item" :class="{active : tabType == item.used}" @tap="orderTab" v-for="(item, index) in tabList" :key="index" :data-state="(item.used)">
@@ -74,8 +83,8 @@
<view class="couponItem">
<view class="couponItem-cont">
<view class="couponItem-top">
<view class="couponItem-cont-number">
<text>{{item.price}}</text>
<view class="couponItem-cont-image">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="couponItem-cont-name">
<view class="nowrap couponItem-cont-title">
@@ -86,9 +95,9 @@
</view>
</view>
</view>
<navigator class="couponItem-btn" hover-class="none" :url="'/pages/giftPack/details?id=' + item.id">
<view class="couponItem-btn" @click="couponUrl(item.id, item.from)">
立即使用
</navigator>
</view>
</view>
<view class="couponItem-cont-text" v-if="item.couponShow">
<rich-text :nodes="item.remark"></rich-text>
@@ -131,7 +140,6 @@
</navigator>
</view>
<!-- 是否兑换弹出 -->
<view class="tipsBack" v-if="generalShow"></view>
<view class="tipsCont" v-if="generalShow">
@@ -157,12 +165,13 @@
</view>
</view>
</view>
</view>
</template>
<script>
import { index, coupon, monthsChoose } from '@/apis/interfaces/giftPack'
const jweixin = require('jweixin-module');
import { index, coupon, monthsChoose, shopsUrl, getAuthUrl, authInfo } from '@/apis/interfaces/giftPack'
import AMapLoader from '@vuemap/amap-jsapi-loader';
export default {
data() {
return {
@@ -172,11 +181,13 @@
couponArr : [],
numbers : '',
count : '',
openId : '',
codeData : '',
//Tab列表
tabList : [
{ title : "可兑换", used: 0 },
{ title : "已兑换", used: 1 }
// { title : "已兑换", used: 1 }
],
tabType : 0, //卡券状态
generalId : '', //卡券id
@@ -185,10 +196,46 @@
},
// 生命周期函数--监听页面加载
onLoad(options) {},
onLoad(options) {
if(options != ''){
this.codeData = options.code || '';
}
// 获取首页数据
this.indexInfo()
// window.location.href = "https://www.amap.com/search?query=%E8%9E%8D%E5%88%9B%E4%B9%90%E5%9B%AD&city=230100&geoobj=126.150528%7C45.61094%7C127.139298%7C46.008671&zoom=11"
// Key
// 秘钥73f1992898e143896d4529a8ffead6c3
// 开发文档:
// AMapLoader.load({
// key: "34ea3d2958aee3ffc154738551a976f9"
// }).then(AMap => {
// console.log(this.$refs.amap)
// let aMap = new AMap.Map('amap', {
// zoom:11,//级别
// center: [116.397428, 39.90923],//中心点坐标
// viewMode:'3D'//使用3D视图
// })
// console.log(AMap)
// }).catch(err => {
// console.log(err)
// })
},
// 生命周期函数--监听页面显示
onShow() {
console.log(this.codeData)
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
@@ -196,9 +243,15 @@
this.isUser = true
}
// 获取首页数据
this.indexInfo()
if(this.codeData != ''){
authInfo({
code: this.codeData
}).then(res=>{
// 获取首页数据
this.indexInfo()
}).catch(err=>{})
}
},
methods: {
// 首页数据
@@ -210,12 +263,11 @@
for(let val in listData){
listData[val].schemesShow = false
}
console.log(listData)
this.giftPackArr = listData
this.numbers = res.numbers
this.count = res.coupons_count
this.adverts = res.adverts
this.openId = res.h5_openid
}).catch(err=>{})
} else {
if(uni.getStorageSync("token")) {
@@ -276,6 +328,24 @@
uni.navigateTo({
url: '/pages/giftPack/list?id=' + id
})
// if(this.openId != null) {
// if(!can) {
// this.generalShow = !this.generalShow
// return
// }
// uni.navigateTo({
// url: '/pages/giftPack/list?id=' + id
// })
// return
// }
// oppid
// getAuthUrl({
// url: 'pages/giftPack/index'
// }).then(res=> {
// window.location.href = res
// })
},
// 兑换跳转
@@ -286,7 +356,23 @@
url: '/pages/giftPack/list?id=' + this.generalId
})
}).catch(err=>{})
}
},
// 优惠券跳转详情
couponUrl(id, from) {
if(from == 'washcar') {
shopsUrl(id).then(res=>{
const newUrl = res.url
window.location.href = newUrl
})
return
}
// 跳转分类页
uni.navigateTo({
url: '/pages/giftPack/details?id=' + id
})
},
}
}
</script>
@@ -303,10 +389,32 @@
border-bottom: 130rpx transparent solid;
}
// banner
.campusBanner {
width: 100%;
}
.indexBanner {
padding: 30rpx;
box-sizing: border-box;
}
.banner {
position: relative;
padding-top: 48%;
width: 100%;
background: white;
overflow: hidden;
z-index: 99;
border-radius: 10rpx;
.banner-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.banner-img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
// 推荐
.recommend {
@@ -515,6 +623,19 @@
text {
font-size: 54rpx;
}
}
.couponItem-cont-image {
width: 88rpx;
height: 88rpx;
margin-right: 10rpx;
border-radius: 50%;
padding: 10rpx;
box-sizing: border-box;
background-color: #fff1dd;
image {
width: 100%;
border-radius: 50%;
}
}
.couponItem-cont-name {
color: #72411f;

View File

@@ -1,9 +1,16 @@
<template>
<view class="content">
<view v-for="(item, idx) in adverts" :key="item.cover">
<image class="campusBanner" :src="item.cover" mode="widthFix"></image>
<!-- 卡片轮播 -->
<view class="indexBanner">
<view class="banner">
<swiper class="banner-swiper" interval="5000" autoplay indicator-dots>
<swiper-item v-for="(item, idx) in adverts" :key="item.cover">
<image class="banner-img" :src="item.cover"></image>
</swiper-item>
</swiper>
</view>
</view>
<view class="recommend"></view>
<view class="special-list" v-if="giftPackArr.length > 0">
<navigator hover-class="none" :url="'buy?id=' + item.activity_month_id" class="special-label" v-for="(item, index) in giftPackArr" :key="index">
<view class="special-rebate" v-if="item.label != null">{{item.label}}</view>
@@ -81,6 +88,33 @@
</script>
<style lang="scss" scoped>
.indexBanner {
padding: 30rpx;
box-sizing: border-box;
}
.banner {
position: relative;
padding-top: 48%;
width: 100%;
background: white;
overflow: hidden;
z-index: 99;
border-radius: 10rpx;
.banner-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.banner-img {
width: 100%;
height: 100%;
vertical-align: top;
}
}
}
.content {
background: #fff;
padding-bottom: 40rpx;
@@ -111,7 +145,7 @@
.special-list {
flex-wrap: wrap;
display: flex;
padding: 30rpx;
padding: 0 30rpx 30rpx;
box-sizing: border-box;
}

View File

@@ -1,40 +1,52 @@
<template>
<view class="content">
<view class="title">
积分记录
<view class="title-name">消费金账户余额</view>
</view>
<view class="list" v-if="accounts.length > 0">
<view class="item" v-for="(item, index) in accounts" :key="index">
<image class="item-img" src="@/static/img/giftPack-img09.png" mode="widthFix"></image>
<view class="item-cont">
<view class="item-cont-top">
<div class="item-cont-name">{{item.title}}</div>
<div class="item-cont-number">{{item.variable}}</div>
</view>
<view class="item-cont-bottom">
<div class="item-cont-total" v-if="userData.gold">余额{{userData.gold.balance}}</div>
<div class="item-cont-time">{{item.created_at}}</div>
<view class="redBack">
<view class="list">
<view class="label">
<view class="label-title">可用余额<image src="/static/icon/giftPack-show.png" mode="widthFix"></image></view>
<view class="label-number">{{account.gold}}</view>
<view class="label-go">可用余额入账记录 </view>
</view>
<view class="label">
<view class="label-title">待发放</view>
<view class="label-number">{{blockeds}}</view>
<navigator hover-class="none" :url="'/pages/giftPack/logsFrozen?type=gold' + '&blockeds=' + blockeds" class="label-go">立即查询 > </navigator>
</view>
</view>
</view>
<view class="integra-cont">
<view class="integra-title">
<view class="integra-title-name">明细记录</view>
<view class="integra-title-picker">
<picker @change="screenBind" :value="screenIndex" :range-key="'name'" :range="screenArray">
{{screenArray[screenIndex].name}}
</picker>
<image class="integra-title-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view class="integra-cont-list" v-if="accounts.length > 0">
<view class="integra-cont-label" v-for="(item, index) in accounts" :key="index">
<view class="integra-cont-title">
<view class="integra-cont-name">{{item.title}}</view>
<view class="integra-cont-tips">消费金余额</view>
</view>
<view class="integra-cont-time">扣除时间{{item.created_at}}</view>
<view class="integra-cont-number">{{item.variable}}</view>
</view>
</view>
<view class="pagesLoding" v-if="lodingStats">
<block v-if="page.has_more">
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block v-else>
没有更多了~
</block>
<!-- 暂无内容 -->
<view class="recommend-hint" v-else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="campusTips" v-else>
<view class="campusTips-cont">
<image src="/static/img/giftPack-null.png" mode="aspectFill"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</view>
</template>
@@ -44,12 +56,27 @@
export default {
data() {
return {
userData : '', //用户
blockeds : '',
account : '',
accounts : '', // 账户列表
page: {
has_more: false
}, // 下一页
lodingStats: false // 数据加载完渲染
screenArray : [
{
channel: 'all',
name: '全部'
},
{
channel: 'in',
name: '入账'
},
{
channel: 'out',
name: '出账'
}
], //账变记录筛选数组
screenChannel: '', //账变记录筛选数组标识
screenIndex : 0 , //账变记录筛选index
page : 1, //分页
lodingStats : false //加载状态
}
},
@@ -60,51 +87,53 @@
// 获取账变记录
this.accountInfo();
// 获取用户接口
this.userInfo();
},
methods: {
// 用户接口
userInfo() {
// 获取用户信息
index().then(res => {
this.userData = res
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
});
},
// 账变记录
accountInfo(page) {
logs({
type : 'gold',
page : page,
channel : 'all'
page : page || '',
channel : this.screenChannel
}).then(res=>{
let newStores = this.accounts,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.data)
this.accounts = newData
this.blockeds = res.blockeds
this.account = res.account
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
})
},
// 筛选账变记录-条件
screenBind(e) {
this.screenIndex = e.detail.value,
this.screenChannel= this.screenArray[e.detail.value].channel
// 获取账变记录
this.accountInfo();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取账变记录
this.accountInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 获取账变记录
this.accountInfo(pageNumber);
}
}
}
}
</script>
@@ -113,75 +142,184 @@
.content {
padding: 30rpx;
box-sizing: border-box;
background-color: #fff9f9;
height: 100vh;
overflow-y: scroll;
}
.title {
font-size: 36rpx;
font-size: 34rpx;
font-weight: 600;
text-align: center;
.title-name {
text-align: center;
position: relative;
width: 440rpx;
margin: 0 auto;
color: #f25448;
line-height: 60rpx;
&::after,
&::before {
position: absolute;
content: '';
top: calc(50% - 14rpx);
background-image: url('/static/img/giftPackArrow.png');
background-size: 100%;
background-position: center;
width: 80rpx;
height: 28rpx;
display: block;
}
&::after {
left: 0;
transform: rotate(180deg);
}
&::before {
right: 0;
}
}
}
.redBack {
background-image: linear-gradient(to top, #fe796f, #f25549);
border-radius: 30rpx;
padding: 30rpx 0 40rpx;
box-sizing: border-box;
margin: 30rpx 0;
position: relative;
}
.redBack::after,
.redBack::before {
position: absolute;
content: '';
left: 20rpx;
border-radius: 0 0 20rpx 20rpx;
}
.redBack::after {
background-color: rgba(243, 85, 73, .4);
z-index: 2;
width: calc(100% - 40rpx);
left: 20rpx;
bottom: -14px;
height: 14px;
}
.redBack::before {
background-color: rgba(243, 85, 73, .2);
z-index: 1;
width: calc(100% - 80rpx);
left: 40rpx;
bottom: -50rpx;
height: 50rpx;
}
.list {
margin-top: 30rpx;
.item {
background-color: #fff;
border-radius: 10rpx;
display: flex;
.label {
flex: 2;
color: #ffffff;
box-sizing: border-box;
&:last-child {
padding-left: 60rpx;
position: relative;
}
&:first-child {
padding-left: 40rpx;
padding-right: 20rpx;
}
&:last-child::after {
position: absolute;
content: '';
left: 0;
top: 15%;
width: 2rpx;
height: 70%;
background-color: #ffffff;
opacity: .6;
}
}
.label-title {
line-height: 54rpx;
display: flex;
image {
width: 32rpx;
margin: 14rpx 0 0 15rpx;
}
}
.label-number {
margin: 10rpx 0 30rpx;
font-size: 48rpx;
font-weight: 600;
}
.label-go {
font-size: 26rpx;
opacity: .9;
}
}
.integra-cont {
margin-top: 100rpx;
.integra-title {
display: flex;
margin-bottom: 30rpx;
.integra-title-name {
font-size: 36rpx;
font-weight: 600;
flex: 1;
}
.integra-title-picker {
display: flex;
color: #797979;
font-size: 32rpx;
.integra-title-icon {
width: 28rpx;
height: 28rpx;
margin: 6rpx 0 0 10rpx;
}
}
}
.integra-cont-label {
background-color: #ffffff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.item-img {
width: 54rpx;
margin-top: 25rpx;
border-radius: 20rpx;
margin-bottom: 30rpx;
position: relative;
.integra-cont-title {
display: flex;
line-height: 40rpx;
.integra-cont-tips {
margin-left: 20rpx;
color: #ff9833;
border: 2rpx solid #ff9833;
border-radius: 80rpx;
font-size: 26rpx;
padding: 0 15rpx;
}
}
.item-cont {
width: calc(100% - 54rpx);
padding-left: 30rpx;
box-sizing: border-box;
.item-cont-top {
display: flex;
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
.item-cont-name {
flex: 1;
}
}
.item-cont-bottom {
font-size: 28rpx;
color: #a4a4a4;
display: flex;
.item-cont-total {
flex: 1;
}
}
.integra-cont-time {
font-size: 26rpx;
color: #666666;
margin-top: 20rpx;
}
.integra-cont-number {
position: absolute;
top: 50rpx;
right: 30rpx;
color: #f25448;
font-size: 38rpx;
}
}
}
.campusTips {
margin-top: 40rpx;
padding: 30rpx;
box-sizing: border-box;
.campusTips-cont {
background-color: #fff;
border-radius: 20rpx;
text-align: center;
padding: 80rpx;
box-sizing: border-box;
color: #9c7557;
image {
width: 340rpx;
height: 280rpx;
margin-bottom: 30rpx;
}
.campusTips-cont-go {
display: inline-block;
border: #9c7557 2rpx solid;
line-height: 66rpx;
padding: 0 40rpx;
margin-top: 30rpx;
font-size: 28rpx;
border-radius: 90rpx;
}
}
/* 暂无内容 */
.recommend-hint {
text-align: center;
color: #999;
padding: 100rpx 0;
}
.recommend-hint image {
width: 200rpx;
height: 200rpx;
}
</style>

View File

@@ -0,0 +1,341 @@
<template>
<view class="content">
<view class="grantSwiper" v-if="frozenData.length > 0">
<view class="banner-height">
<view class="grantTop">
<image class="grantTop-img" src="https://card.ysd-bs.com/storage/materials/2023/07/20/7ebb8b87cf537179f79ba96b77da6ab7.png" mode="scaleToFill"></image>
<view class="grantTop-text">
<!-- <image :src="type == 'silver' ? 'https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_identity_00.png' : 'https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_identity_01.png'"></image> -->
<view class="grantTop-price">
<text>待发放(额度)</text>
<view class="grantTop-price-tips"></view>{{total}}
</view>
</view>
</view>
</view>
<view class="grantIssue">
<view class="grantIssue-list">
<view class="grantIssue-label" v-for="(item, index) in frozenData" :key="index">
<image class="grantIssue-label-img active" src="https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_img.png" mode="scaleToFill"></image>
<view class="grantIssue-label-cont">
<view class="grantIssue-label-left">
<view class="grantIssue-left-top" :class="{active : item.status == 0}"><text>{{item.variable}}</text></view>
<view class="grantIssue-left-number" :class="{active : item.status == 0}">发放额度</view>
</view>
<view class="grantIssue-label-center">
<view class="grantIssue-center-top" :class="{active : item.status == 0}">
<text>{{item.title}}</text>
</view>
<view class="grantIssue-center-time">发放时间{{item.grant_time}}</view>
</view>
<view class="grantIssue-label-right" :class="{active : item.status == 0}">{{item.status_text}}</view>
</view>
<image class="grantIssue-label-tips active" src="https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_btn.png" mode="scaleToFill">
</image>
</view>
</view>
</view>
</view>
<view class="no-pack-center pack-center pages-hint" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/Account_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</template>
<script>
import { ungrantsNew } from '@/apis/interfaces/user'
export default {
data() {
return {
type : '', //类型
total : '',
frozenData : [], //数组列表
blockeds : '', //待发放金额
page : 1, //分页
lodingStats : false //加载状态
}
},
// 生命周期函数--监听页面加载
onLoad (options) {
this.type = options.type
this.blockeds = options.blockeds
// 获取冻结列表
this.frozenInfo()
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
},
methods: {
// 冻结列表
frozenInfo(page) {
ungrantsNew({
type : this.type,
page : page || ''
}).then(res=>{
console.log(res)
let newStores = this.frozenData,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.logs.data)
this.frozenData = newData
this.total = res.total,
this.page = res.logs.page
this.lodingStats = false
uni.stopPullDownRefresh()
})
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取冻结列表
this.frozenInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 获取冻结列表
this.frozenInfo(pageNumber);
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
box-sizing: border-box;
background-color: #fff9f9;
height: 100vh;
overflow-y: scroll;
}
.grantSwiper {
width: 100%;
box-sizing: border-box;
}
.grantTop {
position: relative;
width: 100%;
height: 300rpx;
color: #ffe3a4;
}
.grantTop-img {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.grantTop-text,
.grantTop-tips {
position: absolute;
z-index: 9;
left: 0;
width: 100%;
}
.grantTop-text {
top: 0;
padding: 40rpx 60rpx;
box-sizing: border-box;
}
.grantTop-text image {
width: 120rpx;
height: 40rpx;
}
.grantTop-price {
text-align: center;
font-size: 60rpx;
margin: 30rpx 0;
}
.grantTop-price text {
font-size: 32rpx;
display: block;
color: #fff;
}
.grantTop-price-tips {
display: inline-block;
font-size: 54rpx;
margin-top: 20rpx;
}
.grantIssue-title {
height: 120rpx;
}
.grantIssue-title-name {
line-height: 44rpx;
display: flex;
}
.grantIssue-title-name image {
width: 42rpx;
height: 42rpx;
margin-right: 20rpx;
}
.grantIssue-title-name text {
font-weight: 600;
font-size: 32rpx;
background-image: -webkit-linear-gradient(left, #fbdebe, #e5ad7a);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.grantIssue-title-tips {
font-size: 26rpx;
margin: 10rpx 0 30rpx;
color: #d2d6e2;
}
.grantIssue-title-tips text {
color: #dcbc8d;
}
.grantIssue-label {
position: relative;
height: 180rpx;
margin-top: 30rpx;
border-radius: 10rpx;
overflow: hidden;
background-color: #f9dabb;
}
.grantIssue-label:last-child {
margin-bottom: 0;
}
.grantIssue-label-img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.grantIssue-label-img.active,
.grantIssue-label-tips.active {
-webkit-filter: grayscale(50%);
-moz-filter: grayscale(50%);
-ms-filter: grayscale(50%);
-o-filter: grayscale(50%);
filter: grayscale(50%);
filter: gray;
}
.grantIssue-label-cont {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 6;
padding: 20rpx;
box-sizing: border-box;
display: flex;
}
.grantIssue-label-left {
width: 160rpx;
text-align: center;
margin-top: 20rpx;
}
.grantIssue-left-top {
color: #e9083d;
font-size: 26rpx;
}
.grantIssue-left-top.active,
.grantIssue-center-top.active{
color: #ba926a;
}
.grantIssue-label-right.active {
color: #ba926a;
}
.grantIssue-left-number.active {
background: -webkit-linear-gradient(left, #fce1d6, #fce1d6);
color: #fc7f45;
}
.grantIssue-left-top text {
font-size: 22rpx;
}
.grantIssue-left-top text {
font-size: 36rpx;
font-weight: 600;
padding: 0 6rpx;
}
.grantIssue-left-number {
background: -webkit-linear-gradient(left, #ffdca4, #f8af52);
color: #b13509;
border-radius: 30rpx;
display: inline-block;
font-size: 22rpx;
height: 42rpx;
line-height: 42rpx;
padding: 0 15rpx;
margin-top: 12rpx;
}
.grantIssue-label-right {
width: 100rpx;
font-weight: 600;
text-align: center;
font-size: 26rpx;
color: #3d2a26;
line-height: 140rpx;
}
.grantIssue-label-center {
width: calc(100% - 270rpx);
margin: 20rpx 0 0 20rpx;
}
.grantIssue-center-top {
font-size: 32rpx;
margin-bottom: 20rpx;
color: #0f004a;
font-weight: 600;
}
.grantIssue-center-time {
font-size: 26rpx;
color: #d6a06a;
}
.grantIssue-label-tips {
position: absolute;
width: 140rpx;
height: 100%;
right: 0;
top: 0;
}
</style>

View File

@@ -1,8 +1,9 @@
<template>
<view class="content">
<view class="user">
<image src="/static/img/giftPackCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加此活动
</view>
<view class="user">
<image src="/static/img/giftPackCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加此活动
</view>
<!-- 我的卡券 -->
<view class="campusCont">
<!-- 卡券tab -->
@@ -17,8 +18,8 @@
<view class="couponItem" v-for="(item, index) in coupons" :key="index" :class="{active: item.status != 0}">
<view class="couponItem-cont">
<view class="couponItem-top">
<view class="couponItem-cont-number">
<text>{{item.price}}</text>
<view class="couponItem-cont-image">
<image :src="item.cover" mode="widthFix"></image>
</view>
<view class="couponItem-cont-name">
<view class="nowrap couponItem-cont-title">
@@ -29,9 +30,9 @@
</view>
</view>
</view>
<navigator v-if="item.status == 0" class="couponItem-btn" hover-class="none" :url="'/pages/giftPack/details?id=' + item.id">
<view v-if="item.status == 0" class="couponItem-btn" @click="couponUrl(item.id, item.from)">
立即使用
</navigator>
</view>
<view v-else-if="item.status == 1" class="couponItem-btn">
已使用
</view>
@@ -82,7 +83,7 @@
<script>
import { index } from '@/apis/interfaces/user'
import { coupon } from '@/apis/interfaces/giftPack'
import { coupon, shopsUrl } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
@@ -96,7 +97,10 @@
],
stateType : '0', //卡券状态
type : '', //卡券来源
followState : false //二维码弹出状态
followState : false, //二维码弹出状态
page : 1, //分页
lodingStats : false //加载状态
}
},
@@ -133,16 +137,23 @@
},
methods: {
// 卡券列表
couponInfo() {
couponInfo(page) {
coupon({
status: this.stateType
status : this.stateType,
page : page || ''
}).then(res=>{
var listData = res.data
for(let val in listData){
listData[val].couponShow = false
let newStores = this.coupons,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.data)
for(let val in newData){
newData[val].couponShow = false
}
this.coupons = listData
this.coupons = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
if (!err.login) {
uni.showModal({
@@ -175,17 +186,41 @@
},
// 优惠券跳转详情
couponUrl(e) {
let newId = e.currentTarget.dataset.id
couponUrl(id, from) {
if(from == 'washcar') {
shopsUrl(id).then(res=>{
const newUrl = res.url
window.location.href = newUrl
})
return
}
// 跳转分类页
uni.navigateTo({
url: '/pages/giftPack/details?id=' + newId
url: '/pages/giftPack/details?id=' + id
})
},
// 公众号展示
followBtn() {
this.followState = !this.followState
}
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取团购列表
this.couponInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.couponInfo(pageNumber)
}
}
}
}
</script>
@@ -423,6 +458,19 @@
font-size: 54rpx;
}
}
.couponItem-cont-image {
width: 88rpx;
height: 88rpx;
margin-right: 10rpx;
border-radius: 50%;
padding: 10rpx;
box-sizing: border-box;
background-color: #fff1dd;
image {
width: 100%;
border-radius: 50%;
}
}
.couponItem-cont-name {
color: #72411f;
padding-left: 40rpx;

View File

@@ -154,7 +154,7 @@
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
color: rgba($color: #f25448, $alpha: .5);
}
}
}

View File

@@ -3,7 +3,7 @@
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">超级红包活动用户注册</view>
<view class="title">联通全额消费金活动用户注册</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_red.png" mode="aspectFill"></image>
</view>
@@ -166,7 +166,7 @@
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
color: rgba($color: #f25448, $alpha: .5);
}
}
}

View File

@@ -92,7 +92,7 @@
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
color: rgba($color: #f25448, $alpha: .5);
}
}
}

View File

@@ -3,7 +3,7 @@
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campusLogin_logo.png" mode="aspectFill"></image>
<view class="title">超级红包活动登录</view>
<view class="title">联通全额消费金活动登录</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_red.png" mode="aspectFill"></image>
</view>
@@ -98,7 +98,12 @@
_this.disabled = true
}
}, 1000)
}).catch(err=>{})
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
},
@@ -180,7 +185,7 @@
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
color: rgba($color: #f25448, $alpha: .5);
}
}
}

View File

@@ -0,0 +1,389 @@
<template>
<view class="content">
<image class="superRed-back" src="/static/img/superRed.jpg" mode="widthFix"></image>
<view class="superRed-cont">
<image class="superRed-img" src="/static/img/superRed-img.png" mode="widthFix"></image>
<view class="superRed-see">
<view class="superRed-white">
<view class="superRed-title"><text>领取消费金</text></view>
<view class="packetText-form">
<view class="packetText-title">
<view class="packetText-title-name">请输入办理业务手机号</view>
<text>185XXXX0001</text>
</view>
<form action="" @submit="forgetlogin">
<view class="packetText-label">
<input class="inputs-input" type="text" placeholder="请输入办理业务的手机号" @input="getNameValue"
:value="mobile"></input>
</view>
<view class="packetText-label">
<input class="inputs-input" placeholder="请输入验证码" @input="getCodeValue" :value="code"></input>
<button class="packetText-code" @click="codeBind" hover-class="none" :disabled="disabled">{{codename}}</button>
</view>
<view class="packetText-label">
<input class="inputs-input" type="text" placeholder="消费金使用账户【微信关联手机号码】" @input="getMobileValue"
:value="getMobile"></input>
</view>
<view class="packetText-cozy">
<view class="packetText-cozy-name">温馨提示</view>
<text>1.消费金仅限本系统使用</text>
<text>2.消费金当月有效当月权益请在当月使用</text>
<text>3.如消费金兑换成电子券后请按电子券有效期使用如逾期未用视为放弃使用资格平台将不予补发不予延期</text>
</view>
<view class="packetText-btn">
<button type="default" form-type="submit"><text>立即领取</text></button>
</view>
</form>
</view>
</view>
</view>
</view>
<view class="popBack" :class="{active : popContHide}"></view>
<view class="popCont" :class="{active : popContHide}">
<image class="popCont-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/receive.png" mode="widthFix"></image>
<view class="popCont-text">
<view class="popCont-name">领取成功,共领取<text>{{popData}}</text>,可在账户中查看</view>
<view class="popCont-btn" @click="popClick">我知道了 <text v-if="countDownNum > 0">({{countDownNum}})</text></view>
</view>
</view>
</view>
</template>
<script>
import { send } from '@/apis/interfaces/auth'
import { monthsPacket } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
mobile : '', //手机号码
code : '',
getMobile : '',
iscode : null, //用于存放验证码接口里获取到的code
codename : '获取验证码',
countDownNum: '',
popContHide : false, //领取成功弹出
popData : '', //领取金额
disabled : false
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
},
methods: {
// 获取手机号码
getNameValue(e) {
this.mobile = e.detail.value
},
// 获取验证码
getCodeValue(e) {
this.code = e.detail.value
},
// 获取领取红包的手机号
getMobileValue(e) {
this.getMobile = e.detail.value
},
// code发送
codeBind(e){
this.disabled = true
let mobile = this.mobile,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
var _this = this
if (mobile == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobile)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({
mobile : mobile,
channel :'DEFAULT',
type : 'month'
}).then(res=>{
uni.showToast({
title : '发送成功',
icon : 'success',
duration: 2000
})
var num = 61;
var timer = setInterval(function () {
num--;
if (num <= 0) {
clearInterval(timer);
_this.codename = '重新发送',
_this.disabled = false
} else {
_this.codename = num + "s后重新获取",
_this.disabled = true
}
}, 1000)
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
}
},
// 立即领取
forgetlogin(e) {
let mobile = this.mobile,
getmobile = this.getMobile,
code = this.code,
that = this,
countDownNum = 5 //获取倒计时初始值
that.countDownNum = countDownNum
monthsPacket({
mobile : mobile,
get_mobile: getmobile,
channel : 'DEFAULT',
code : code
}).then(res=>{
that.popContHide = !this.popContHide
that.popData = res
var timerPop = setInterval(function () {
countDownNum--;
that.countDownNum = countDownNum
if (countDownNum <= 0) {
clearInterval(timerPop);
that.countDownNum = 0
uni.switchTab({
url: '/pages/user/index'
})
}
}, 1000)
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 关闭弹窗
popClick() {
this.popContHide = !this.popContHide
// 跳转
uni.redirectTo({
url: '/pages/giftPack/index'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #f31a16;
height: 100vh;
overflow-y: scroll;
position: relative;
}
.superRed-back {
width: 100%;
position: absolute;
}
.superRed-cont {
top: 0;
position: absolute;
.superRed-img {
width: 100%;
}
.superRed-see {
padding: 0 30rpx 30rpx;
box-sizing: border-box;
.superRed-white {
position: relative;
background-color: #fffcf4;
border-radius: 20rpx;
padding: 80rpx 30rpx 30rpx;
box-sizing: border-box;
.superRed-title {
width: 100%;
position: absolute;
text-align: center;
top: -38rpx;
left: 0;
text {
display: inline-block;
background-color: #f95433;
box-shadow: 0 8rpx 5rpx rgba(249, 84, 51, .4);
border: 4rpx solid #ffeca0;
line-height: 76rpx;
padding: 0 50rpx;
border-radius: 80rpx;
color: #ffffff;
font-weight: 600;
font-size: 40rpx;
}
}
}
}
}
.packetText-title {
display: flex;
color: #f25448;
line-height: 48rpx;
.packetText-title-name {
font-weight: 600;
font-size: 32rpx;
}
text{
font-size: 26rpx;
}
}
.packetText-label {
height: 100rpx;
line-height: 100rpx;
margin-top: 40rpx;
background-color: #ffffff;
border-radius: 80rpx;
padding: 0 40rpx;
box-sizing: border-box;
display: flex;
.inputs-input {
display: inline-block;
height: 100%;
flex: 1;
}
.packetText-code {
line-height: 100rpx;
border: none;
background-color: transparent;
border: none;
width: auto !important;
padding: 0;
font-weight: normal;
font-size: 28rpx;
color: #f25448;
&::after {
display: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.packetText-cozy {
color: #f25448;
margin-top: 40rpx;
font-size: 26rpx;
padding: 0 10rpx;
box-sizing: border-box;
.packetText-cozy-name {
font-weight: 600;
margin-bottom: 20rpx;
}
text {
padding: 10rpx 0 10rpx 30rpx;
box-sizing: border-box;
position: relative;
display: block;
line-height: 34rpx;
&::after {
position: absolute;
content: '';
left: 0;
top: 24rpx;
width: 10rpx;
height: 10rpx;
background-color: #f25448;
transform: rotate(45deg);
}
}
}
.packetText-btn {
text-align: center;
padding: 60rpx 30rpx 40rpx;
box-sizing: border-box;
button {
background-image: linear-gradient(to bottom, #ff4459, #fe1924);
box-shadow: 0 8rpx 5rpx rgba(249, 84, 51, .4);
border-radius: 80rpx;
color: #ffffff;
line-height: 94rpx;
}
}
/* 弹出 */
.popBack {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .8);
z-index: 8;
display: none;
}
.popCont {
position: fixed;
z-index: 9;
width: 100vw;
height: 100vh;
text-align: center;
display: none;
}
.popCont-text {
padding: 0 10rpx;
box-sizing: border-box;
position: absolute;
z-index: 10;
left: 20%;
top: 340px;
width: 60%;
}
.popBack.active,
.popCont.active {
display: block;
}
.popCont-name {
margin-bottom: 50rpx;
font-size: 30rpx;
}
.popCont-name text {
font-size: 40rpx;
color: #fd5238;
padding: 0 10rpx;
}
.popCont-btn {
background-color: #ffea37;
color: #ff3900;
display: inline-block;
border-radius: 80rpx;
padding: 20rpx 70rpx;
box-shadow: 0 10rpx 10rpx rgba(196, 160, 0, 0.4);
}
</style>

392
pages/giftPack/superRed.vue Normal file
View File

@@ -0,0 +1,392 @@
<template>
<view class="content">
<image class="superRed-back" src="https://card.ysd-bs.com/storage/materials/2023/08/08/视频权益包2.png" mode="widthFix"></image>
<view class="superRed-cont">
<view class="superRed-img">
<image src="https://card.ysd-bs.com/storage/materials/2023/08/08/img.png" mode="widthFix"></image>
</view>
<view class="superRed-see">
<form action="" @submit="forgetlogin">
<view class="superRed-white">
<view class="packetText-form">
<view class="packetText-label">
<label>手机号码</label>
<input class="inputs-input" type="text" placeholder="请输入办理业务的手机号" @input="getNameValue"
:value="mobile"></input>
</view>
<view class="packetText-label">
<label>验证码</label>
<input class="inputs-input" placeholder="请输入验证码" @input="getCodeValue" :value="code"></input>
<button class="packetText-code" @click="codeBind" hover-class="none" :disabled="disabled">{{codename}}</button>
</view>
<view class="packetText-label">
<label>账户</label>
<input class="inputs-input" type="text" placeholder="消费金使用账户【微信关联手机号码】" @input="getMobileValue"
:value="getMobile"></input>
</view>
</view>
</view>
<view class="packetText-btn">
<button type="default" form-type="submit"><image src="https://card.ysd-bs.com/storage/materials/2023/08/08/45ffe3c74b6ab4fb2a303d19a714d15c.png" mode="widthFix"></image></button>
</view>
</form>
</view>
<view class="packetText-cozy">
<image src="https://card.ysd-bs.com/storage/materials/2023/08/08/视频权益包2_07.png" mode="widthFix"></image>
<!-- <view class="packetText-cozy-name">温馨提示</view>
<text>1.消费金仅限本系统使用</text>
<text>2.消费金当月有效当月权益请在当月使用</text>
<text>3.如消费金兑换成电子券后请按电子券有效期使用如逾期未用视为放弃使用资格平台将不予补发不予延期</text> -->
</view>
</view>
<view class="popBack" :class="{active : popContHide}"></view>
<view class="popCont" :class="{active : popContHide}">
<image class="popCont-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/receive.png" mode="widthFix"></image>
<view class="popCont-text">
<!-- <view class="popCont-name">领取成功,共领取<text>{{popData}}</text>,可在账户中查看</view> -->
<view class="popCont-name">恭喜您已成功领取消费金在使用时请您链接消费金使用界面用微信关联手机号重新注册登录</view>
<view class="popCont-btn" @click="popClick">我知道了 <text v-if="countDownNum > 0">({{countDownNum}})</text></view>
</view>
</view>
</view>
</template>
<script>
import { send } from '@/apis/interfaces/auth'
import { monthsPacket } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
mobile : '', //手机号码
code : '',
getMobile : '',
iscode : null, //用于存放验证码接口里获取到的code
codename : '获取验证码',
countDownNum: '',
popContHide : false, //领取成功弹出
popData : '', //领取金额
disabled : false
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
},
methods: {
// 获取手机号码
getNameValue(e) {
this.mobile = e.detail.value
},
// 获取验证码
getCodeValue(e) {
this.code = e.detail.value
},
// 获取领取红包的手机号
getMobileValue(e) {
this.getMobile = e.detail.value
},
// code发送
codeBind(e){
this.disabled = true
let mobile = this.mobile,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
var _this = this
if (mobile == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobile)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({
mobile : mobile,
channel :'DEFAULT',
type : 'month'
}).then(res=>{
uni.showToast({
title : '发送成功',
icon : 'success',
duration: 2000
})
var num = 61;
var timer = setInterval(function () {
num--;
if (num <= 0) {
clearInterval(timer);
_this.codename = '重新发送',
_this.disabled = false
} else {
_this.codename = num + "s后重新获取",
_this.disabled = true
}
}, 1000)
}).catch(err => {
_this.disabled = false
uni.showToast({
icon: 'none',
title: err.message
})
})
}
},
// 立即领取
forgetlogin(e) {
let mobile = this.mobile,
getmobile = this.getMobile,
code = this.code,
that = this,
countDownNum = 5 //获取倒计时初始值
that.countDownNum = countDownNum
monthsPacket({
mobile : mobile,
get_mobile: getmobile,
channel : 'DEFAULT',
code : code
}).then(res=>{
that.popContHide = !this.popContHide
that.popData = res
var timerPop = setInterval(function () {
countDownNum--;
that.countDownNum = countDownNum
if (countDownNum <= 0) {
clearInterval(timerPop);
that.countDownNum = 0
uni.switchTab({
url: '/pages/giftPack/user'
})
}
}, 1000)
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 关闭弹窗
popClick() {
this.popContHide = !this.popContHide
// 跳转
// uni.redirectTo({
// url: '/pages/giftPack/index'
// })
}
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
overflow-y: scroll;
position: relative;
}
.superRed-back {
width: 100%;
position: absolute;
}
.superRed-cont {
padding-top: 120rpx;
top: 0;
position: absolute;
.superRed-img {
width: 100%;
padding: 30rpx;
box-sizing: border-box;
image {
width: 100%;
}
}
.superRed-see {
padding: 0 30rpx 30rpx;
box-sizing: border-box;
.superRed-white {
position: relative;
background-color: #ffffff;
border-radius: 20rpx;
padding: 30rpx 15rpx;
box-sizing: border-box;
.superRed-title {
width: 100%;
position: absolute;
text-align: center;
top: -38rpx;
left: 0;
text {
display: inline-block;
background-color: #f95433;
box-shadow: 0 8rpx 5rpx rgba(249, 84, 51, .4);
border: 4rpx solid #ffeca0;
line-height: 76rpx;
padding: 0 50rpx;
border-radius: 80rpx;
color: #ffffff;
font-weight: 600;
font-size: 40rpx;
}
}
}
}
}
.packetText-title {
display: flex;
color: #f25448;
line-height: 48rpx;
.packetText-title-name {
font-weight: 600;
font-size: 32rpx;
}
text{
font-size: 26rpx;
}
}
.packetText-label {
height: 90rpx;
line-height: 90rpx;
margin-bottom: 40rpx;
background-color: #ffffff;
border-radius: 80rpx;
padding: 0 20rpx;
box-sizing: border-box;
display: flex;
font-size: 32rpx;
label {
color: #1444d9;
font-weight: 600;
}
.inputs-input {
display: inline-block;
height: 100%;
flex: 1;
font-size: 28rpx;
border: 4rpx solid #000000;
border-radius: 10rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.packetText-code {
line-height: 90rpx;
background-color: #1444d9;
border: none;
width: auto !important;
padding: 0 25rpx;
font-weight: normal;
font-size: 28rpx;
color: #ffffff;
margin-left: 20rpx;
&::after {
display: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.packetText-cozy {
color: #f25448;
font-size: 26rpx;
padding: 0 10rpx;
box-sizing: border-box;
image {
width: 100%;
}
}
.packetText-btn {
text-align: center;
padding: 60rpx 30rpx 0;
box-sizing: border-box;
button {
background-color: transparent;
border: none;
image {
width: 100%;
}
&::after {
display: none;
}
}
}
/* 弹出 */
.popBack {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .8);
z-index: 8;
display: none;
}
.popCont {
position: fixed;
z-index: 9;
width: 100vw;
height: 100vh;
text-align: center;
display: none;
}
.popCont-text {
padding: 0 10rpx;
box-sizing: border-box;
position: absolute;
z-index: 10;
left: 20%;
top: 340px;
width: 60%;
}
.popBack.active,
.popCont.active {
display: block;
}
.popCont-name {
margin-bottom: 50rpx;
font-size: 30rpx;
}
.popCont-name text {
font-size: 40rpx;
color: #fd5238;
padding: 0 10rpx;
}
.popCont-btn {
background-color: #ffea37;
color: #ff3900;
display: inline-block;
border-radius: 80rpx;
padding: 20rpx 70rpx;
box-shadow: 0 10rpx 10rpx rgba(196, 160, 0, 0.4);
}
</style>

View File

@@ -33,14 +33,14 @@
<view class="userItem-label-number">
<block v-if="isUser">
<image class="userItem-label-img" src="@/static/img/giftPack-img04.png" mode="widthFix"></image>
<block v-if="userData.gold"><text>{{userData.gold.overdue ? userData.gold.overdue : '0'}}</text></block>
<block v-if="userData.gold"><text>{{blockeds ? blockeds : '0'}}</text></block>
</block>
<block v-else>
<image class="userItem-label-img" src="@/static/img/giftPack-img03.png" mode="widthFix"></image>
<text>0</text>
</block>
</view>
<view class="userItem-label-text">已过期</view>
<view class="userItem-label-text">待发放 <navigator :url="'/pages/giftPack/logsFrozen?type=gold' + '&blockeds=' + blockeds">查看明细></navigator></view>
</view>
</view>
<view class="userList" @click="userNav('/pages/giftPack/logs')">
@@ -65,6 +65,13 @@
<image class="userCoupon-arrow" src="@/static/icon/rightsArrow.png" mode="widthFix"></image>
</view>
</view>
<!-- <view class="userCoupon" @click="userNav('/pages/giftPack/superRed')">
<image class="userCoupon-img" src="@/static/img/giftPack-img10.png" mode="widthFix"></image>
<view class="userCoupon-cont">
<view class="userCoupon-name">领取消费金</view>
<image class="userCoupon-arrow" src="@/static/icon/rightsArrow.png" mode="widthFix"></image>
</view>
</view> -->
<view class="userTool">
<view class="userTool-title">
@@ -107,11 +114,14 @@
<script>
import { index } from '@/apis/interfaces/user'
import { logs } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
isUser : false, // 用户是否登录
userData: '', //用户
screenChannel: '', //账变记录筛选数组标识
blockeds : ''
}
},
@@ -127,8 +137,10 @@
this.isUser = true
// 获取用户接口
this.userInfo();
}
// 获取首页数据
this.accountInfo();
}
},
methods: {
// 用户接口
@@ -154,6 +166,19 @@
});
},
// 账变记录
accountInfo(page) {
logs({
type : 'gold',
page : page || '',
channel : this.screenChannel
}).then(res=>{
this.blockeds = res.blockeds
})
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url

View File

@@ -12,7 +12,7 @@
<view class="packetText-title-name">请输入办理业务手机号</view>
<text>185XXXX0001</text>
</view>
<form action="" bindsubmit="forgetlogin">
<form action="" @submit="forgetlogin">
<view class="packetText-label">
<image src="/static/img/packetText_icon.png"></image>
<input class="inputs-input" type="text" placeholder="请输入手机号领取红包" @input="getNameValue"

View File

@@ -114,11 +114,16 @@
// 导航
siteMap(){
uni.openLocation({
latitude : parseFloat(this.storeinfo.latitude),
longitude : parseFloat(this.storeinfo.longitude),
address : this.storeinfo.address
})
// uni.openLocation({
// latitude : parseFloat(this.storeinfo.latitude),
// longitude : parseFloat(this.storeinfo.longitude),
// address : this.storeinfo.address
// })
let key = '34ea3d2958aee3ffc154738551a976f9',//高德地图key
latitude = parseFloat(this.storeinfo.latitude),
longitude = parseFloat(this.storeinfo.longitude)
window.location.href = "http://uri.amap.com/marker?position="+ longitude +","+latitude +"&name="+ name +"&coordinate=gaode&callnative=1";
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/img/superRed-img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

BIN
static/img/superRed.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB