[本时生活新增活动-月兑]

This commit is contained in:
2023-05-23 16:51:14 +08:00
parent 409eb507f3
commit d739cb5a37
745 changed files with 62963 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{ // launch.json 配置了启动调试时相关设置configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"h5" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}

123
本时生活H5/App.vue Normal file
View File

@@ -0,0 +1,123 @@
<script>
var QQMapWX = require("./utils/qqmap-wx-jssdk.min.js");
var qqmapsdk;
import { config } from '@/apis/interfaces/wxJSDK'
export default {
onLaunch() {
// config({
// list : ["requestPayment", "updateAppMessageShareData"],
// url : location.href.split('#')[0]
// }).then(res=>{
// this.$wx.config(res)
// })
this.qqmapsdk = new QQMapWX({
key: '4KYBZ-LCAKF-QWOJN-NIDNZ-FZHLZ-2XFW7'
}); // 版本更新提示
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
globalData:{
envType : '',
shareObj : {
type : '',
goodsId : '',
userId : ''
}
}
}
</script>
<style>
/*每个页面公共css */
page {
background-color: #f3f3f3;
}
/* 文字截取 */
.nowrap {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.nowrap-multi {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
/* 水平居中 */
.pack-center {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -1;
}
/* 页面信息提醒 */
.pages-hint {
text-align: center;
color: #747788;
font-size: 28rpx;
background: white;
}
.pages-hint image {
width: 188rpx;
height: 188rpx;
}
/* 上拉加载 */
.pagesLoding{
text-align: center;
line-height: 90rpx;
color: gray;
}
.pagesLoding-icon{
width: 28rpx;
height: 28rpx;
vertical-align: middle;
margin-right: 10rpx;
margin-bottom: 3rpx;
}
/* 下边框 */
.uni-border-top,
.uni-border-bottom {
position: relative;
}
.uni-border-top::after,
.uni-border-bottom::after {
position: absolute;
content: '';
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.uni-border-top::after {
top: 0;
}
.uni-border-bottom::after {
bottom: 0;
}
</style>

View File

@@ -0,0 +1,83 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 我的地址列表
const index = () => {
return request({
url : 'addresses'
})
}
// 删除地址
const remove = (addressId) => {
return request({
url : 'addresses/' + addressId + '/destroy',
method: "DELETE"
})
}
// 删除地址
const setdef = (addressId) => {
return request({
url : 'addresses/' + addressId + '/setdef',
method: "POST"
})
}
// 获取省
const create = () => {
return request({
url : 'addresses/create'
})
}
// 获取市级列表
const children = (psn) => {
return request({
url : 'areas/children',
data: {
psn
}
})
}
// 创建地址保存
const add = (data) => {
return request({
url : 'addresses/store',
method: "POST",
data: data
})
}
// 编辑地址保存
const keep = (addressId, data) => {
return request({
url : 'addresses/' + addressId + '/update',
method: "POST",
data: data
})
}
// 获取已有地址信息
const edit = (addressId) => {
return request({
url : 'addresses/' + addressId + '/edit'
})
}
export {
index,
remove,
setdef,
create,
children,
add,
keep,
edit
}

View File

@@ -0,0 +1,69 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
// 手机号+验证码登录
const auth = (data) => {
return request({
url: 'auth/login_by_code',
method: 'POST',
data: data
})
}
// 设置登录密码
const passSetup = (data) => {
return request({
url: 'auth/reset_password',
method: 'POST',
data: data
})
}
// 手机号+密码登录
const passlogin = (data) => {
return request({
url: 'auth/login_by_password',
method: 'POST',
data: data
})
}
// 注册
const register = (data) => {
return request({
url: 'auth/register',
method: 'POST',
data: data
})
}
// 领取红包-发送短信-获取验证码
const send = (data) => {
return request({
url: 'sms/send',
method: 'POST',
data: data
})
}
// 领取红包-领取
const unicom = (data) => {
return request({
url: 'unicom/get',
method: 'POST',
data: data
})
}
export {
auth,
passSetup,
passlogin,
register,
send,
unicom
}

View File

@@ -0,0 +1,95 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
const index = (data) => {
return request({
url: 'schools'
})
}
//卡券二维码
const qrcode = (coupon_id) => {
return request({
url: 'coupons/qrcode',
data: {
coupon_id
}
})
}
//门店列表
const barcode = (coupon_id) => {
return request({
url: "coupons/" + coupon_id + '/barcode'
})
}
//卡券二维码
const couponinfo = (data) => {
return request({
url: "coupons/show",
data: data
})
}
// 获取商家券信息
const merchantCard = (coupon_id) => {
return request({
url: "coupons/merchant_card",
method: "GET",
data: {
coupon_id
}
})
}
// 校园活动确认订单
const buy = (data) => {
return request({
url : "schools/buy",
data: data
})
}
// 校园活动提交订单
const buySubmit = (data) => {
return request({
url : "schools/buy",
method : "POST",
data : data
})
}
// 卡券分组
const coupon = (data) => {
return request({
url : "coupons",
data : data
})
}
// 卡券分组
const breakCode = (coupon_id) => {
return request({
url : "coupons/qrcode",
data: {
coupon_id
}
})
}
export {
index,
qrcode,
barcode,
couponinfo,
merchantCard,
buy,
buySubmit,
coupon,
breakCode
}

View File

@@ -0,0 +1,79 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
* 抽奖活动
*/
import request from '../request'
// 首页
const index = (data) => {
return request({
url: 'activity/exchanges'
})
}
// 抽奖
const result = (exchange_id) => {
return request({
url: 'activity/exchanges/' + exchange_id + '/draw'
})
}
// 抽奖默认信息(抽奖次数)
const awards = (exchange_id, data) => {
return request({
url: 'activity/exchanges/' + exchange_id + "/awards",
data: data
})
}
// 我的订单
const orders = (data) => {
return request({
url: 'activity/exchanges/orders',
data: data
})
}
// 我的优惠券
const coupons = (data) => {
return request({
url: 'activity/exchanges/coupons',
data: data
})
}
// 产品选择
const exchanges = (log_id) => {
return request({
url: 'activity/exchanges/log/' + log_id
})
}
// 兑换产品
const exchangesBuy = (data) => {
return request({
url: 'activity/exchanges/buy',
method: 'POST',
data: data
})
}
// 兑换产品
const activityBuy = (data) => {
return request({
url: 'activity/exchanges/buy',
data: data
})
}
export {
index,
result,
awards,
orders,
coupons,
exchanges,
exchangesBuy,
activityBuy
}

View File

@@ -0,0 +1,61 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
// 月兑活动 - 首页
const index = (data) => {
return request({
url: 'months'
})
}
// 月兑活动 - 商品详情
const details = (month_id) => {
return request({
url : "months/" + month_id
})
}
// 月兑活动 - 确认订单
const buy = (data) => {
return request({
url : "months/buy",
data: data
})
}
// 月兑活动 - 提交订单
const buySubmit = (data) => {
return request({
url : "months/buy",
method : "POST",
data : data
})
}
// 月兑活动 - 优惠券列表
const logs = (data) => {
return request({
url : "account/logs",
data : data
})
}
// 月兑活动 - 账变列表
const coupon = (data) => {
return request({
url : "months/coupons",
data : data
})
}
export {
index,
details,
buy,
buySubmit,
coupon,
logs
}

View File

@@ -0,0 +1,73 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 活动权益内容
const activity = (data) => {
return request({
url: 'home',
data: data
})
}
// 钻石+白金权益内容
const index = (data) => {
return request({
url: 'home/group',
data: data
})
}
// 周五福利日订阅
const subscribe = (subscribe) => {
return request({
url: 'wechat/' + subscribe + "/welfare_subscribe",
method: "POST"
})
}
// 所有城市-最新无字母
const newCity = () => {
return request({
url: 'ajax/all_right_citys'
})
}
// 市区选择-最新无字母
const newidxCity = (data) => {
return request({
url: 'ajax/all_right_children',
data: data
})
}
// h5掉起微信授权的前置获取相关的签名信息前置
const subscribeUrl = (data) => {
return request({
url: 'auth/jssdk',
data: data
})
}
const subscribeH5 = (subscribe, channel) => {
return request({
url: "wechat/" + subscribe + "/welfare_subscribe",
method: "POST",
data: {
channel: 'h5'
}
})
}
export {
activity,
index,
subscribe,
newCity,
newidxCity,
subscribeUrl,
subscribeH5
}

View File

@@ -0,0 +1,33 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
const index = (data) => {
return request({
url: 'petros'
})
}
// 校园活动确认订单
const buy = (data) => {
return request({
url : "petros/buy",
data: data
})
}
// 校园活动提交订单
const buySubmit = (data) => {
return request({
url : "petros/buy",
method : "POST",
data : data
})
}
export {
index,
buy,
buySubmit
}

View File

@@ -0,0 +1,30 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 充值前置
const create = () => {
return request({
url : 'recharges/create'
})
}
// 充值提交
const store = (recharge_id) => {
return request({
url : 'recharges/store',
method: 'POST',
data: {
recharge_id
}
})
}
export {
create,
store
}

View File

@@ -0,0 +1,143 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 权益详情
const index = (data) => {
return request({
url : 'orders/create/',
data: data
})
}
// 权益分类
const classify = (category_id, data) => {
return request({
url : 'categories/' + category_id,
data: data
})
}
// 权益购买提交
const rightStore = (data) => {
return request({
url : 'orders/store/',
method: "POST",
data: data
})
}
// 洗车券-获取跳转地址 --暂时隐藏
const washcarUrl = (data) => {
return request({
url: 'washcar/infourl',
data: data
})
}
// 获取洗车券信息
const washcarBuy = (data) => {
return request({
url: 'washcar/create',
data: data
})
}
// 洗车券订单提交
const washcarCreate = (data) => {
return request({
url : 'washcar/create',
method: "POST",
data: data
})
}
// h5微信支付获取微信授权地址
const getAuthUrl = (url) => {
return request({
url : 'auth/get_auth_url',
data: {
url
}
})
}
// h5掉起微信支付的前置获取相关的签名信息
const wpayH5Info = (data) => {
return request({
url : 'auth/jssdk',
data: data
})
}
//获取openid地址-web
const unionpay = (data) => {
return request({
url : 'unionpay/openid',
data: data
})
}
//领取银联权益优惠券
const unionCode = (data) => {
return request({
url : 'unionpay/union_openid',
data: data
})
}
// 权益 单订单支付
const rightsSingle = (orderid) => {
return request({
url : 'payments/order',
data: {
orderid
}
})
}
// h5掉起微信支付的前置获取相关的签名信息
// const fridayPayH5 = (url, data) => {
// return request({
// url : 'payments/welfare/wechat',
// method: "POST",
// data: data
// })
// }
// H5 权益支付
// const wechatH5 = (data) => {
// return request({
// url : 'payments/wechat',
// method: "POST",
// data: data
// })
// }
const h5Pay = (url, data) => {
return request({
url: url,
method: "POST",
data
})
}
export {
index,
classify,
rightStore,
washcarUrl,
washcarBuy,
washcarCreate,
getAuthUrl,
wpayH5Info,
unionpay,
unionCode,
rightsSingle,
h5Pay
}

View File

@@ -0,0 +1,27 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
// 业务信息
const business = (type) => {
return request({
url: "business/" + type
})
}
// 提交预约
const create = (data) => {
return request({
url: "business/create",
method: "POST",
data: data
})
}
export {
business,
create
}

View File

@@ -0,0 +1,33 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
const index = (data) => {
return request({
url: 'activity/unicoms'
})
}
// 校园活动确认订单
const buy = (data) => {
return request({
url : "activity/unicoms/buy",
data: data
})
}
// 校园活动提交订单
const buySubmit = (data) => {
return request({
url : "activity/unicoms/buy",
method : "POST",
data : data
})
}
export {
index,
buy,
buySubmit
}

View File

@@ -0,0 +1,419 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 活动权益内容
const index = () => {
return request({
url: 'user'
})
}
// 卡券详情
const couponinfo = (data) => {
return request({
url: 'coupons/show',
data: data
})
}
// 卡券二维码
const qrcode = (coupon_id) => {
return request({
url: 'coupons/qrcode',
data: {
coupon_id
}
})
}
// 卡券条形码
const barcode = (coupon_id) => {
return request({
url: 'coupons/' + coupon_id + '/barcode'
})
}
// 卡券列表
const coupon = (status) => {
return request({
url: 'coupons?status=' + status
})
}
// 卡券分组
const couponArr = (data) => {
return request({
url: 'coupons/list',
data: data
})
}
// 积分账变记录
const logs = (data) => {
return request({
url: 'account/logs',
data: data
})
}
// 订单收益列表
const profits = (data) => {
return request({
url: 'data/profits',
data: data
})
}
// 订单收益列表-下级明细
const profitsNext = (data) => {
return request({
url: 'data/profitlogs',
data: data
})
}
// 积分卡激活
const cards = (data) => {
return request({
url: 'user/cards/activate',
method: "POST",
data: data
})
}
// 冻结列表
const ungrants = (type) => {
return request({
url: 'account/newungrants',
data: {
type
}
})
}
// 洗车券-获取跳转地址
const washcarCoupon = (coupon) => {
return request({
url: 'washcar/' + coupon + "/info",
method: "POST"
})
}
//权益商品订单列表
const orders = (data) => {
return request({
url: 'orders/index',
data: data
})
}
//权益订单列表
const ordersCoupons = (data) => {
return request({
url: 'orders/coupons',
data: data
})
}
//取消兑换订单
const cancel = (orderid) => {
return request({
url: 'orders/cancel?orderid=' + orderid,
method: "POST"
})
}
// 福利商品订单列表
const welfare = (data) => {
return request({
url: 'welfares/orders',
data: data
})
}
// 福利券订单列表
const welfareCoupons = (data) => {
return request({
url: 'welfares/coupons',
data: data
})
}
// 福利取消订单
const welfaresCancel = (orderid) => {
return request({
url: 'welfares/orders/cancel?orderid=' + orderid,
method: "POST"
})
}
//权益订单详情
const show = (orderid) => {
return request({
url: 'orders/show',
data: {
orderid
}
})
}
//周五福利订单详情
const welfaresShow = (orderid) => {
return request({
url: 'welfares/orders/show',
data: {
orderid
}
})
}
// 头像上传+昵称修改
const upload = (data) => {
return request({
url: 'user/setting/info',
method: "POST",
data: data
})
}
// 发送短信
const send = (data) => {
return request({
url: 'sms/send',
method: "POST",
data: data
})
}
// 设置支付密码
const setPassword = (data) => {
return request({
url: 'user/setting/set_password',
method: "POST",
data: data
})
}
// 修改支付密码
const changePassword = (data) => {
return request({
url: 'user/setting/change_password',
method: "POST",
data: data
})
}
// 重置支付密码
const resetPassword = (data) => {
return request({
url: 'user/setting/reset_password',
method: "POST",
data: data
})
}
//门店列表
const stores = (data) => {
return request({
url: 'coupons/new_stores',
method: "POST",
data: data
})
}
//门店详情
const storesShow = (data) => {
return request({
url: 'coupons/store/show',
data: data
})
}
//省市区
const areas = (psn) => {
return request({
url: 'areas/children?psn=' + psn
})
}
// 2021-07-28新增
// 我的收益
const myProfit = () => {
return request({
url: 'data/index'
})
}
// 我的收益-收益报表
const myIncome = (month) => {
return request({
url: 'data/income',
data:{
month
}
})
}
// 我的收益-收益报表 + 我的收益-我的团队
const profitUrl = (url, data) => {
return request({
url: url,
data: data
})
}
// 提现前置账户信息
const withdraws = () => {
return request({
url: 'withdraws/create'
})
}
// 提现记录列表
const withdrawsList = (data) => {
return request({
url: 'user/withdraws',
data: data
})
}
// 提现表单填写
const withdrawsForm = (data) => {
return request({
url: 'withdraws',
method: "POST",
data: data
})
}
// 权益详细列表
const profitLogs = (data) => {
return request({
url: 'data/logs',
data: data
})
}
// 转账获取积分账户分类
const transfers = () => {
return request({
url: 'user/transfers'
})
}
// 转账提交表单
const transfersForm = (data) => {
return request({
url: 'user/transfers',
method: "POST",
data: data
})
}
// 校验转账的手机号码
const ajaxTel = (mobile) => {
return request({
url: 'ajax/user',
data: {
mobile
}
})
}
// 产品分享 - 新增
const productList = (page) => {
return request({
url: 'shares/goods',
data: {
page
}
})
}
const productInfo = (right) => {
return request({
url: 'shares/goods/' + right
})
}
const productPoster = (right) => {
return request({
url: 'shares/goods/' + right + '/poster'
})
}
// 我的分享
const myshare = (data) => {
return request({
url: 'user/share',
data: data
})
}
// 产品分享二维码+储值分享二维码
const publicCode = (data) => {
return request({
url: 'user/share/goods',
data: data
})
}
// 储值分享
const storedList = () => {
return request({
url: 'shares/recharges'
})
}
export {
index,
couponinfo,
qrcode,
barcode,
coupon,
couponArr,
logs,
profits,
profitsNext,
cards,
ungrants,
washcarCoupon,
orders,
ordersCoupons,
cancel,
welfare,
welfareCoupons,
welfaresCancel,
show,
welfaresShow,
upload,
send,
setPassword,
changePassword,
resetPassword,
stores,
storesShow,
areas,
myProfit,
myIncome,
profitUrl,
withdraws,
withdrawsList,
withdrawsForm,
profitLogs,
transfers,
transfersForm,
ajaxTel,
productList,
productInfo,
productPoster,
myshare,
publicCode,
storedList
}

View File

@@ -0,0 +1,40 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request.js'
// 周五福利日详情
const index = (welfare_id, data) => {
return request({
url : 'welfare/' + welfare_id,
data: data
})
}
//周五福利-获取支付信息
const fridayInfo = (welfare_id, data) => {
return request({
url : 'welfare/order/' + welfare_id,
data: data
})
}
// 周五福利 单订单支付
const welfSingle = (orderid) => {
return request({
url : 'payments/welfare',
data: {
orderid
}
})
}
export {
index,
fridayInfo,
welfSingle
}

View File

@@ -0,0 +1,17 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import request from '../request'
const config = (data) => {
return request({
url : 'auth/jssdk',
data: data
})
}
export {
config
}

View File

@@ -0,0 +1,139 @@
/**
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import store from '@/store'
// 基础配置
// https://lifetest.ysd-bs.com //测试地址
// https://card.ysd-bs.com
const config = {
apiUrl : 'https://lifetest.ysd-bs.com/api/',
timeout: 60000
}
let loginHintState = false
// 网络请求
const request = (parameter) => {
// 检查url配置
if(parameter.url === 'undefined' || parameter.url === '') {
uni.showToast({
title: '请求地址不能为空',
icon : 'none'
})
return
}
// 注入header
config.header = {
'Accept': 'application/json',
'Authorization': store.getters.getToken || ''
}
// 请求实例
return new Promise((resolve, reject) => {
uni.request({
url : config.apiUrl + parameter.url,
timeout : config.timeout,
header : config.header || {},
data : parameter.data || {},
method : parameter.method || 'GET',
success: res => {
if (res.header.Authorization) {
updateToken('token', res.header.Authorization)
}
if (res.statusCode === 200) {
const resolveData = res.data
if(resolveData.status_code === 200) {
resolve(resolveData.data)
return
}
if (resolveData.status_code === 401) {
loginHint()
return
}
reject(resolveData)
return
}
errToast(res.statusCode)
}
})
})
}
// 处理一些http请求错误提示
const errToast = (code) => {
switch (code){
case 404:
uni,uni.showToast({
title: code + '接口不存在,请联系系统管理员',
icon : none
})
break;
case 405:
uni.showToast({
title: code + '请检查接口请求方式错误',
icon :'none'
})
break;
case 500:
uni.showToast({
title: code + '服务端错误,请检查服务器信息',
icon : 'none'
})
break;
}
}
// 更新token
const updateToken = (token) => {
store.commit('setToken', token)
}
// 处理登录提示
const loginHint = () => {
if(loginHintState) return
if(!loginHintState) loginHintState = true
updateToken('')
uni.showModal({
title:'登录提示',
content:'您的登录信息已过期,请重新登录',
confirmColor:'#33f800',
showCancel:false,
success: res => {
console.log(getApp().globalData.envType)
loginHintState = false
if(res.confirm){
if(getApp().globalData.envType == 'campusEnv') {
uni.reLaunch({
url: '/pages/campus/signin'
})
} else if(getApp().globalData.envType == 'oilEnv') {
uni.reLaunch({
url: '/pages/oil/signin'
})
}else if(getApp().globalData.envType == 'unicomEnv') {
uni.reLaunch({
url: '/pages/unicom/signin'
})
}else if(getApp().globalData.envType == 'drawEnv') {
uni.reLaunch({
url: '/pages/draw/signin'
})
}else if(getApp().globalData.envType == 'giftPEnv') {
uni.reLaunch({
url: '/pages/giftPack/signin'
})
}else {
uni.reLaunch({
url: '/pages/auth/login'
})
}
}
}
})
}
export default request

View File

@@ -0,0 +1,41 @@
/** clipboard.js v2.0.4**/
!function(t,e){try{global.ClipboardJS=e();}catch(e){};"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}
return r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}
return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),c=o(n(3)),u=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}
var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}
return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,c.default),i(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===r(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return s("action",t)||'copy'}},{key:"defaultTarget",value:function(t){var e=s("target",t);if(e){return document.querySelector(e)}}},{key:"defaultText",value:function(t){return s("text",t)||this.text}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function s(t,e){var n="data-clipboard-"+t;let isFun=e&&typeof e.hasAttribute==='function';if(isFun&&e.hasAttribute(n)){return e.getAttribute(n)}}
t.exports=l},function(t,e,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}
return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=n(2),c=(o=a)&&o.__esModule?o:{default:o};var u=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}
return i(e,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,c.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,c.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}
this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),e}();t.exports=u},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}
return e}},function(t,e){function n(){}
n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}
return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var d=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(l=t).addEventListener(s,f),{destroy:function(){l.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,u=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,u)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,u)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,u,l,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}
t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}
t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])});let Types={isFunction:function(obj){var type=Object.prototype.toString.call(obj)
return type=='[object Function]'},isObject:function(obj){var type=Object.prototype.toString.call(obj)
return type=='[object Object]'},isString:function(obj){var type=Object.prototype.toString.call(obj)
return type=='[object String]'}}
//#ifdef H5
uni.setClipboardData=function(options){let emptyFun=function(){}
let config={data:null,event:null,success:emptyFun,fail:emptyFun,complete:emptyFun}
if(options&&Types.isObject(options)){config=Object.assign({},config,options)}
if(options&&Types.isString(options)){config=Object.assign({},config,{data:options})}
let data=config.data
let success=config.success||emptyFun
let fail=config.fail||emptyFun
let complete=config.complete||emptyFun
let e=config.event||window.event||{}
let cb=new ClipboardJS('.null',{text:()=>data})
cb.on('success',function(res){success&&Types.isFunction(success)&&success(res)
complete&&Types.isFunction(complete)&&complete()
cb.off('error')
cb.off('success')
cb.destroy()})
cb.on('error',function(err){fail&&Types.isFunction(fail)&&fail(err)
complete&&Types.isFunction(complete)&&complete()
cb.off('error')
cb.off('success')
cb.destroy()})
cb.onClick(e)}
//#endif

22
本时生活H5/main.js Normal file
View File

@@ -0,0 +1,22 @@
import Vue from 'vue'
import App from './App'
import store from './store'
import { VueJsonp } from 'vue-jsonp'
Vue.config.productionTip = false
// Vue.config.ignoredElements = ['wx-open-subscribe']
Vue.prototype.$store = store
Vue.prototype.$wx = require('jweixin-module')
App.mpType = 'app'
// jsonp
Vue.use(VueJsonp)
const app = new Vue({
...App
})
app.$mount()

View File

@@ -0,0 +1,106 @@
{
"name" : "本时生活H5",
"appid" : "__UNI__8D6D53E",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {
"Payment" : {}
},
/* */
"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.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_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_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.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {
"payment" : {
"weixin" : {
"__platform__" : [ "android" ],
"appid" : "wx0e1082e90b9aa6a5",
"UniversalLinks" : ""
}
},
"ad" : {}
}
}
},
/* */
"quickapp" : {},
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
/* */
"mp-weixin" : {
"appid" : "wx8e424dbdc443381f",
"setting" : {
"urlCheck" : false,
"postcss" : false
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"h5" : {
"router" : {
"mode" : "history"
},
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "4KYBZ-LCAKF-QWOJN-NIDNZ-FZHLZ-2XFW7"
}
}
},
"title" : "本时生活"
}
}

16
本时生活H5/node_modules/.yarn-integrity generated vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"systemParams": "win32-x64-93",
"modulesFolders": [
"node_modules"
],
"flags": [],
"linkedModules": [],
"topLevelPatterns": [
"jweixin-module@^1.6.0"
],
"lockfileEntries": {
"jweixin-module@^1.6.0": "https://registry.yarnpkg.com/jweixin-module/-/jweixin-module-1.6.0.tgz#4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd"
},
"files": [],
"artifacts": {}
}

30
本时生活H5/node_modules/jweixin-module/README.md generated vendored Normal file
View File

@@ -0,0 +1,30 @@
# jweixin-module
微信JS-SDK
## 安装
### NPM
```shell
npm install jweixin-module --save
```
### UMD
```http
https://unpkg.com/jweixin-module/out/index.js
```
## 使用
```js
var jweixin = require('jweixin-module')
jweixin.ready(function(){
// TODO
});
```
## 完整API
>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,56 @@
{
"_args": [
[
"jweixin-module@1.6.0",
"H:\\ysd-card\\h5-mobile"
]
],
"_from": "jweixin-module@1.6.0",
"_id": "jweixin-module@1.6.0",
"_inBundle": false,
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
"_location": "/jweixin-module",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "jweixin-module@1.6.0",
"name": "jweixin-module",
"escapedName": "jweixin-module",
"rawSpec": "1.6.0",
"saveSpec": null,
"fetchSpec": "1.6.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"_spec": "1.6.0",
"_where": "H:\\ysd-card\\h5-mobile",
"author": {
"name": "Shengqiang Guo"
},
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"description": "微信JS-SDK",
"devDependencies": {},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"license": "ISC",
"main": "lib/index.js",
"name": "jweixin-module",
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"scripts": {},
"version": "1.6.0"
}

21
本时生活H5/node_modules/vue-jsonp/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 LancerComet
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

153
本时生活H5/node_modules/vue-jsonp/README.md generated vendored Normal file
View File

@@ -0,0 +1,153 @@
# Vue-jsonp
[![VueJsonp](https://github.com/LancerComet/vue-jsonp/workflows/Test/badge.svg)](https://github.com/LancerComet/vue-jsonp/actions)
A tiny library for handling JSONP request.
## Quick Start
As Vue plugin:
```ts
import { VueJsonp } from 'vue-jsonp'
// Vue Plugin.
Vue.use(VueJsonp)
// Now you can use this.$jsonp in Vue components.
const vm = new Vue()
vm.$jsonp('/some-jsonp-url', {
myCustomUrlParam: 'veryNice'
})
```
Use function directly:
```ts
import { jsonp } from 'vue-jsonp'
jsonp('/some-jsonp-url', {
myCustomUrlParam: 'veryNice'
})
```
## Send data and set query & function name
### Send data
```ts
// The request url will be "/some-jsonp-url?name=LancerComet&age=100&callback=jsonp_{RANDOM_STR}".
jsonp('/some-jsonp-url', {
name: 'LancerComet',
age: 100
})
```
### Custom query & function name
The url uniform is `/url?{callbackQuery}={callbackName}&...`, the default is `/url?callback=jsonp_{RANDOM_STRING}&...`.
And you can change it like this:
```ts
// The request url will be "/some-jsonp-url?name=LancerComet&age=100&cb=jsonp_func".
jsonp('/some-jsonp-url', {
callbackQuery: 'cb',
callbackName: 'jsonp_func',
name: 'LancerComet',
age: 100
})
```
## Module exports
- `VueJsonp: PluginObject<never>`
- `jsonp<T>: (url: string, param?: IJsonpParam, timeout?: number) => Promise<T>`
## API
### IJsonpParam
IJsonpParam is the type of param for jsonp function.
```ts
/**
* JSONP parameter declaration.
*/
interface IJsonpParam {
/**
* Callback query name.
* This param is used to define the query name of the callback function.
*
* @example
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
* jsonp('/some-url', {
* callbackQuery: 'myCallback',
* callbackName: 'jsonp_func',
* myCustomUrlParam: 'veryNice'
* })
*
* @default callback
*/
callbackQuery?: string
/**
* Callback function name.
* This param is used to define the jsonp function name.
*
* @example
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
* jsonp('/some-url', {
* callbackQuery: 'myCallback',
* callbackName: 'jsonp_func',
* myCustomUrlParam: 'veryNice'
* })
*
* @default jsonp_ + randomStr()
*/
callbackName?: string
/**
* Custom data.
*/
[key: string]: any
}
```
## Example
```ts
import Vue from 'vue'
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
const vm = new Vue()
const { code, data, message } = await vm.$jsonp<{
code: number,
message: string,
data: {
id: number,
nickname: string
}
}>('/my-awesome-url', {
name: 'MyName', age: 20
})
assert(code === 0)
assert(message === 'ok')
assert(data.id === 1)
assert(data.nickname === 'John Smith')
```
```ts
import { jsonp } from 'vue-jsonp'
const result = await jsonp<string>('/my-awesome-url')
assert(result === 'such a jsonp')
```
## License
MIT

73
本时生活H5/node_modules/vue-jsonp/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,73 @@
/**
* Vue Jsonp.
* # Carry Your World #
*
* @author: LancerComet
* @license: MIT
*/
import { PluginObject } from 'vue/types/plugin';
declare module 'vue/types/vue' {
interface Vue {
$jsonp: typeof jsonp;
}
}
/**
* Vue JSONP.
*/
declare const VueJsonp: PluginObject<never>;
/**
* JSONP function.
*
* @param { string } url Target URL address.
* @param { IJsonpParam } param Querying params object.
* @param { number } timeout Timeout setting (ms).
*
* @example
* jsonp('/url', {
* callbackQuery: ''
* callbackName: '',
* name: 'LancerComet',
* age: 26
* }, 1000)
*/
declare function jsonp<T = any>(url: string, param?: IJsonpParam, timeout?: number): Promise<T>;
export { VueJsonp, jsonp };
/**
* JSONP parameter declaration.
*/
interface IJsonpParam {
/**
* Callback query name.
* This param is used to define the query name of the callback function.
*
* @example
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
* jsonp('/some-url', {
* callbackQuery: 'myCallback',
* callbackName: 'jsonp_func',
* myCustomUrlParam: 'veryNice'
* })
*
* @default callback
*/
callbackQuery?: string;
/**
* Callback function name.
* This param is used to define the jsonp function name.
*
* @example
* // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice"
* jsonp('/some-url', {
* callbackQuery: 'myCallback',
* callbackName: 'jsonp_func',
* myCustomUrlParam: 'veryNice'
* })
*
* @default jsonp_ + randomStr()
*/
callbackName?: string;
/**
* Custom data.
*/
[key: string]: any;
}

View File

@@ -0,0 +1,8 @@
function e(t,n){t=t.replace(/=/g,"");var o=[];switch(n.constructor){case String:case Number:case Boolean:o.push(encodeURIComponent(t)+"="+encodeURIComponent(n));break;case Array:n.forEach((function(n){o=o.concat(e(t+"[]=",n))}));break;case Object:Object.keys(n).forEach((function(r){var a=n[r];o=o.concat(e(t+"["+r+"]",a))}))}return o}function t(e){var n=[];return e.forEach((function(e){"string"==typeof e?n.push(e):n=n.concat(t(e))})),n}
/**
* Vue Jsonp.
* # Carry Your World #
*
* @author: LancerComet
* @license: MIT
*/var n={install:function(e){e.prototype.$jsonp=o}};function o(n,o,r){if(void 0===o&&(o={}),"string"!=typeof n)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof o||!o)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(a,c){var u="string"==typeof o.callbackQuery?o.callbackQuery:"callback",i="string"==typeof o.callbackName?o.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);o[u]=i,delete o.callbackQuery,delete o.callbackName;var s=[];Object.keys(o).forEach((function(t){s=s.concat(e(t,o[t]))}));var l=t(s).join("&"),f=function(){p(),clearTimeout(m),c({status:400,statusText:"Bad Request"})},p=function(){b.removeEventListener("error",f)},d=function(){document.body.removeChild(b),delete window[i]},m=null;r>-1&&(m=setTimeout((function(){p(),d(),c({statusText:"Request Timeout",status:408})}),r)),window[i]=function(e){clearTimeout(m),p(),d(),a(e)};var b=document.createElement("script");b.addEventListener("error",f),b.src=n+(/\?/.test(n)?"&":"?")+l,document.body.appendChild(b)}))}export{n as VueJsonp,o as jsonp};

8
本时生活H5/node_modules/vue-jsonp/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueJsonp={})}(this,(function(e){"use strict";function t(e,o){e=e.replace(/=/g,"");var n=[];switch(o.constructor){case String:case Number:case Boolean:n.push(encodeURIComponent(e)+"="+encodeURIComponent(o));break;case Array:o.forEach((function(o){n=n.concat(t(e+"[]=",o))}));break;case Object:Object.keys(o).forEach((function(r){var c=o[r];n=n.concat(t(e+"["+r+"]",c))}))}return n}function o(e){var t=[];return e.forEach((function(e){"string"==typeof e?t.push(e):t=t.concat(o(e))})),t}
/**
* Vue Jsonp.
* # Carry Your World #
*
* @author: LancerComet
* @license: MIT
*/var n={install:function(e){e.prototype.$jsonp=r}};function r(e,n,r){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof n||!n)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(c,a){var i="string"==typeof n.callbackQuery?n.callbackQuery:"callback",s="string"==typeof n.callbackName?n.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);n[i]=s,delete n.callbackQuery,delete n.callbackName;var u=[];Object.keys(n).forEach((function(e){u=u.concat(t(e,n[e]))}));var f=o(u).join("&"),l=function(){p(),clearTimeout(b),a({status:400,statusText:"Bad Request"})},p=function(){m.removeEventListener("error",l)},d=function(){document.body.removeChild(m),delete window[s]},b=null;r>-1&&(b=setTimeout((function(){p(),d(),a({statusText:"Request Timeout",status:408})}),r)),window[s]=function(e){clearTimeout(b),p(),d(),c(e)};var m=document.createElement("script");m.addEventListener("error",l),m.src=e+(/\?/.test(e)?"&":"?")+f,document.body.appendChild(m)}))}e.VueJsonp=n,e.jsonp=r,Object.defineProperty(e,"__esModule",{value:!0})}));

View File

@@ -0,0 +1,20 @@
/**
* Generate random string.
*
* @return { string }
*/
declare function randomStr(): string;
/**
* Format params into querying string.
*
* @return {string[]}
*/
declare function formatParams(queryKey: string, value: any): string[];
/**
* Flat querys.
*
* @param {string[] | (string[])[]} array
* @returns
*/
declare function flatten(array: string[] | (string[])[]): string[];
export { formatParams, flatten, randomStr };

80
本时生活H5/node_modules/vue-jsonp/package.json generated vendored Normal file
View File

@@ -0,0 +1,80 @@
{
"_from": "vue-jsonp",
"_id": "vue-jsonp@2.0.0",
"_inBundle": false,
"_integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA==",
"_location": "/vue-jsonp",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "vue-jsonp",
"name": "vue-jsonp",
"escapedName": "vue-jsonp",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
"_shasum": "3bfac56bb72941a2511c11e1a123b876f03427f7",
"_spec": "vue-jsonp",
"_where": "H:\\工作项目\\BSlive\\本时生活H5",
"author": {
"name": "LancerComet",
"email": "chw644@hotmail.com"
},
"bugs": {
"url": "https://github.com/LancerComet/vue-jsonp/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A tiny library for handling JSONP request.",
"devDependencies": {
"@types/expect-puppeteer": "^4.4.3",
"@types/jest": "^26.0.14",
"@types/jest-environment-puppeteer": "^4.4.0",
"@types/puppeteer": "^3.0.2",
"jest": "^26.4.2",
"jest-puppeteer": "^4.4.0",
"puppeteer": "^5.3.1",
"rollup": "^2.28.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.3",
"ts-jest": "^26.4.1",
"tslint": "^6.1.3",
"typescript": "^4.0.3",
"vue": "^2.6.12"
},
"files": [
"dist/",
"index.d.ts",
"README.md"
],
"homepage": "https://github.com/LancerComet/vue-jsonp#readme",
"keywords": [
"Vue",
"JSONP"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"name": "vue-jsonp",
"repository": {
"type": "git",
"url": "git+https://github.com/LancerComet/vue-jsonp.git"
},
"scripts": {
"build": "rollup -c",
"prepublish": "npm run test",
"pretest": "npm run build",
"preversion": "npm run test",
"test": "jest"
},
"version": "2.0.0"
}

16
本时生活H5/package-lock.json generated Normal file
View File

@@ -0,0 +1,16 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"vue-jsonp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
"integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA=="
}
}
}

735
本时生活H5/pages.json Normal file
View File

@@ -0,0 +1,735 @@
{
"pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/auth/login",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"app-plus": {
"animationType": "slide-in-bottom"
}
}
},{
"path": "pages/auth/register",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"app-plus": {
"animationType": "slide-in-bottom"
}
}
},{
"path": "pages/auth/password",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"app-plus": {
"animationType": "slide-in-bottom"
}
}
},{
"path": "pages/auth/psssword_forget",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"app-plus": {
"animationType": "slide-in-bottom"
}
}
},{
"path": "pages/auth/password_login",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"navigationStyle": "custom",
"app-plus": {
"animationType": "slide-in-bottom"
}
}
},{
"path": "pages/index/index",
"style": {
"navigationBarTitleText":"首页",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"navigationStyle": "custom"
}
},{
"path": "pages/user/index",
"style": {
"navigationBarTitleText": "个人中心",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},{
"path": "pages/rights/index",
"style": {
"navigationBarTitleText": "卡券权益",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/webView/webView",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/subscribe/upgrade/upgrade",
"style": {
"navigationBarTitleText": "5G升级包预约",
"navigationStyle": "custom",
"navigationBarBackgroundColor":"#2a211e",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/subscribe/combo/combo",
"style": {
"navigationBarTitleText": "冰激凌预约",
"navigationStyle": "custom",
"navigationBarBackgroundColor":"#2a211e",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/switchcity/switchcity",
"style": {
"navigationBarTitleText": "切换城市",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/welfare/welfare",
"style": {
"navigationBarTitleText": "支付详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/classify/classify",
"style": {
"navigationBarTitleText": "卡券权益",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#000000",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/account",
"style": {
"navigationBarTitleText": "账变记录",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/myBalance",
"style": {
"navigationBarTitleText": "收益账户",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/myBalance_list",
"style": {
"navigationBarTitleText": "收益列表",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/myProfit",
"style": {
"navigationBarTitleText": "我的收益",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/myProfit_list",
"style": {
"navigationBarTitleText": "权益列表",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/withdrawal_record",
"style": {
"navigationBarTitleText": "提现记录",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/withdrawal_form",
"style": {
"navigationBarTitleText": "提现申请",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/account/recharge",
"style": {
"navigationBarTitleText": "充值中心",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#dfb48b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/frozen/frozen",
"style": {
"navigationBarTitleText": "待发放",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#24315d",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/favour/favour",
"style": {
"navigationBarTitleText": "积分赠与",
"navigationStyle": "custom",
"navigationBarBackgroundColor": "#24315d",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false
}
},{
"path": "pages/coupon/coupon",
"style": {
"navigationBarTitleText": "我的卡券",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/couponDetails/couponDetails",
"style": {
"navigationBarTitleText": "卡券详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/couponArr/couponArr",
"style": {
"navigationBarTitleText": "我的卡券",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/packet/packet",
"style": {
"navigationBarTitleText": "联通红包",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/activate/activate",
"style": {
"navigationBarTitleText": "卡激活",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/site/index",
"style": {
"navigationBarTitleText": "我的地址",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/site/create",
"style": {
"navigationBarTitleText": "新增地址",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/site/edit",
"style": {
"navigationBarTitleText": "编辑地址",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/washcar/washcar",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/car/index",
"style": {
"navigationBarTitleText": "亿时代",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/order/order",
"style": {
"navigationBarTitleText": "我的订单",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/order/orderData",
"style": {
"navigationBarTitleText": "订单详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/setUpForm/index",
"style": {
"navigationBarTitleText": "个人设置",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/setUpForm/form_submit",
"style": {
"navigationBarTitleText": "个人设置",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/payPassword/index",
"style": {
"navigationBarTitleText": "支付密码",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/payPassword/setup",
"style": {
"navigationBarTitleText": "支付密码设置",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/payPassword/forget",
"style": {
"navigationBarTitleText": "找回密码",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/cashier/index",
"style": {
"navigationBarTitleText": "收银台",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/index",
"style": {
"navigationBarTitleText": "校园迎新活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/buy",
"style": {
"navigationBarTitleText": "活动购买",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/myCoupon",
"style": {
"navigationBarTitleText": "我的优惠券",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/details",
"style": {
"navigationBarTitleText": "活动详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/signin",
"style": {
"navigationBarTitleText": "校园迎新活动 登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/campus/myList",
"style": {
"navigationBarTitleText": "优惠券列表",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/store/index",
"style": {
"navigationBarTitleText": "门店列表",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/store/details",
"style": {
"navigationBarTitleText": "门店详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path" : "pages/campus/register",
"style" : {
"navigationBarTitleText": "快速注册",
"enablePullDownRefresh": false
}
},{
"path" : "pages/campus/password",
"style" : {
"navigationBarTitleText": "忘记密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/campus/setPassword",
"style" : {
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userGoods/index",
"style" : {
"navigationBarTitleText": "产品分享",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userGoods/goodsDet",
"style" : {
"navigationBarTitleText": "产品详情",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userGoods/goodsCode",
"style" : {
"navigationBarTitleText": "产品分享-分享码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/code/code",
"style" : {
"navigationBarTitleText": "我的邀请码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userStored/index",
"style" : {
"navigationBarTitleText": "储值分享",
"enablePullDownRefresh": false
}
},{
"path" : "pages/userStored/storedCode",
"style" : {
"navigationBarTitleText": "储值分享-分享码",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/index",
"style": {
"navigationBarTitleText": "联通优惠活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/buy",
"style": {
"navigationBarTitleText": "活动购买",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/myCoupon",
"style": {
"navigationBarTitleText": "我的优惠券",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/details",
"style": {
"navigationBarTitleText": "活动详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/signin",
"style": {
"navigationBarTitleText": "联通优惠活动 登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/oil/myList",
"style": {
"navigationBarTitleText": "优惠券列表",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path" : "pages/oil/register",
"style" : {
"navigationBarTitleText": "快速注册",
"enablePullDownRefresh": false
}
},{
"path" : "pages/oil/password",
"style" : {
"navigationBarTitleText": "忘记密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/oil/setPassword",
"style" : {
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/index",
"style": {
"navigationBarTitleText": "本时礼包活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/user",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/buy",
"style": {
"navigationBarTitleText": "活动购买",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/myCoupon",
"style": {
"navigationBarTitleText": "我的优惠券",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/details",
"style": {
"navigationBarTitleText": "优惠券详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/giftPack/signin",
"style": {
"navigationBarTitleText": "本时礼包活动 登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/register",
"style" : {
"navigationBarTitleText": "快速注册",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/password",
"style" : {
"navigationBarTitleText": "忘记密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/setPassword",
"style" : {
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/giftPack/logs",
"style" : {
"navigationBarTitleText": "积分记录",
"enablePullDownRefresh": false
}
},{
"path": "pages/unicom/index",
"style": {
"navigationBarTitleText": "中国联通回馈活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/unicom/buy",
"style": {
"navigationBarTitleText": "活动购买",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/unicom/details",
"style": {
"navigationBarTitleText": "活动详情",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/unicom/signin",
"style": {
"navigationBarTitleText": "中国联通回馈活动 登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path" : "pages/unicom/register",
"style" : {
"navigationBarTitleText": "快速注册",
"enablePullDownRefresh": false
}
},{
"path" : "pages/unicom/password",
"style" : {
"navigationBarTitleText": "忘记密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/unicom/setPassword",
"style" : {
"navigationBarTitleText": "重置密码",
"enablePullDownRefresh": false
}
},{
"path": "pages/draw/index",
"style": {
"navigationBarTitleText": "抽奖活动",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path": "pages/draw/signin",
"style": {
"navigationBarTitleText": "抽奖活动 登录",
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/register",
"style" : {
"navigationBarTitleText": "抽奖活动 快速注册",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/password",
"style" : {
"navigationBarTitleText": "抽奖活动 忘记密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/setPassword",
"style" : {
"navigationBarTitleText": "抽奖活动 重置密码",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/myCoupon",
"style" : {
"navigationBarTitleText": "我的优惠券",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/couponDetails",
"style" : {
"navigationBarTitleText": "优惠券详情",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/order",
"style" : {
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/orderDetails",
"style" : {
"navigationBarTitleText": "订单详情",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/logs",
"style" : {
"navigationBarTitleText": "抽奖记录",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/choose",
"style" : {
"navigationBarTitleText": "选择产品",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/right",
"style" : {
"navigationBarTitleText": "购买权益",
"enablePullDownRefresh": false
}
},{
"path" : "pages/draw/success",
"style" : {
"navigationBarTitleText": "兑换成功",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle":"custom"
},
"tabBar": {
"color": "#9b9f9f",
"selectedColor": "#000000",
"backgroundColor": "#FFFFFF",
"borderStyle": "#ddd",
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/tabBarIcon/00.png",
"selectedIconPath": "static/tabBarIcon/00_active.png"
}, {
"pagePath": "pages/user/index",
"text": "我的",
"iconPath": "static/tabBarIcon/01.png",
"selectedIconPath": "static/tabBarIcon/01_active.png"
}]
}
}

View File

@@ -0,0 +1,300 @@
<template>
<view>
<!-- 账户余额 -->
<view class="integra-top">
<view class="integra-name">
<block v-if="balanceType == 'silver'">白金账户余额</block>
<block v-else-if="balanceType == 'drill'">钻石账户余额</block>
</view>
<view class="integra-info">
<view class="integra-right">
<view class="integra-title"><text>可用余额</text><image src="/static/icon/integra_icon00.png"></image></view>
<view class="integra-number">{{ balanceData.number }}</view>
<view class="integra-btn"><text>可用余额入账记录</text></view>
<!-- <navigator class="integra-btn" hover-class="none" url="/pages/account/recharge"><text>立即充值</text><image src="/static/icon/rightsArrow.png"></image></navigator> -->
</view>
<view class="integra-right">
<view class="integra-title"><text>待发放</text><image src="/static/icon/integra_icon01.png"></image></view>
<view class="integra-number">{{ balanceData.blockeds }}</view>
<navigator hover-class="none" :url="'/pages/frozen/frozen?type=' + balanceType + '&blockeds=' + balanceData.blockeds" class="integra-btn integra-blue">立即查询<image src="/static/icon/rightsArrow.png"></image></navigator>
</view>
</view>
</view>
<!-- 账变记录 -->
<view class="integra-cont">
<view class="integra-cont-title">
<view class="integra-cont-name">账变记录</view>
<view class="integra-cont-picker" v-if="balanceData.screenArray[balanceData.screenIndex]">
<picker @change="screenBind" :value="balanceData.screenIndex" :range-key="'name'" :range="balanceData.screenArray">
{{ balanceData.screenArray[balanceData.screenIndex].name }}
</picker>
<image class="integra-cont-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<block v-if="balanceData.accounts.length > 0">
<view class="integra-list" v-for="(item,index) in balanceData.accounts" :key="index">
<view class="integra-text">
<view class="integra-title">
<view class="integra-title-tips" :class="{active : item.channel == 'in'}">{{ item.channel == 'in' ? '入' : '出' }}</view>{{ item.title }}
</view>
<view class="integra-oints" :class="{active : item.channel == 'in'}">
{{ item.variable }}
</view>
</view>
<view class="integra-remark">
{{ item.remark }}
</view>
<view class="integra-date">
<view class="integra-time">
<text>{{ item.channel == 'in' ? '有效期:' : '扣除时间:' }}</text>
{{ item.created_at }}{{ item.channel == 'in' ? ' 至 ' + item.expired_at : '' }}
</view>
</view>
</view>
</block>
<!-- 暂无内容 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</view>
</template>
<script>
import { logs } from '@/apis/interfaces/user'
import { create, store } from '@/apis/interfaces/recharge'
export default {
data() {
return {
balanceType : '', // 卡来源-类型
balanceData : {
blockeds : '', // 待发放余额
number : '', // 账户余额
accounts : [], //账户列表
screenChannel : '', //账变记录筛选数组标识
screenIndex : 0, //账变记录筛选index
screenArray : [
{
channel: 'all',
name: '全部'
},
{
channel: 'in',
name: '入账'
},
{
channel: 'out',
name: '出账'
}
]
},
load: {
page : 1, // 第一页
allpage : 0, // 总页数
has_more: false, // 是否有分页
show : false // 是否有下一页数据
},
finished : false, //商品列表没有更多商品是否显示
LoadData : false //数据加载完渲染
}
},
onLoad(options) {
this.balanceType = options.type
},
onShow() {
// 获取账变记录
this.accountInfo();
},
methods:{
// 账变记录
accountInfo() {
if (this.load.page == 1) {
this.balanceData.accounts = [];
}
logs({
type : this.balanceType,
channel : this.balanceData.screenChannel,
page : this.load.page
}).then(res=>{
//判断金卡、银卡、钻石卡
let number
if(this.balanceType == "silver") {
number = res.account.silver
} else if(this.balanceType == "gold") {
number = res.account.gold
} else if(this.balanceType == "drill") {
number = res.account.drill
} else {
return
}
this.balanceData.accounts = this.balanceData.accounts.concat(res.data)
this.balanceData.number = number
this.balanceData.blockeds = res.blockeds
this.load.allpage = res.page.total_page
this.load.has_more = res.page.has_more
// 数据渲染加载
this.LoadData = true
})
},
// 筛选账变记录-条件
screenBind(e) {
this.balanceData.screenIndex = e.detail.value,
this.balanceData.screenChannel= this.balanceData.screenArray[e.detail.value].channel
// 获取账变记录
this.accountInfo();
},
}
}
</script>
<style lang="scss" scoped>
// 账户余额
.integra-top {
padding: 30rpx 20rpx 0;
background-color: #dfb48b;
border-radius: 0 0 100rpx 100rpx;
.integra-name {
color: #fff;
font-size: 32rpx;
margin-bottom: 30rpx;
}
.integra-info {
background-color: #fff;
text-align: center;
border-radius: 20rpx;
display: flex;
box-shadow: 0 10rpx 10rpx rgba(0, 0, 0, .1);
padding: 30rpx 20rpx;
box-sizing: border-box;
text-align: left;
.integra-right {
flex: 2;
position: relative;
&:first-child {
padding-right: 20rpx;
box-sizing: border-box;
}
&:last-child {
padding-left: 30rpx;
box-sizing: border-box;
}
&:first-child::after {
display: none;
}
.integra-title {
margin-bottom: 20rpx;
display: flex;
image {
width: 36rpx;
height: 36rpx;
margin: 4rpx 0 0 10rpx;
}
}
.integra-number {
font-size: 40rpx;
}
.integra-btn {
font-size: 28rpx;
margin-top: 20rpx;
color: #adadad;
display: flex;
text {
color: #dfb48b;
}
image {
width: 36rpx;
height: 36rpx;
margin-top: 2rpx;
}
}
.integra-blue {
color: #317afa;
}
}
}
}
// 账变记录
.integra-cont-title {
padding: 40rpx 20rpx 10rpx;
display: flex;
.integra-cont-name {
font-weight: 600;
flex: 1;
}
.integra-cont-picker {
display: flex;
color: #797979;
font-size: 30rpx;
.integra-cont-icon {
width: 28rpx;
height: 28rpx;
margin: 6rpx 0 0 10rpx;
}
}
}
.integra-list {
width: calc(100% - 40rpx);
margin: 20rpx;
padding: 30rpx 20rpx;
position: relative;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, .1);
box-sizing: border-box;
background: #fff;
border-radius: 10rpx;
.integra-text {
display: flex;
margin-bottom: 20rpx;
.integra-title {
flex: 1;
font-size: 30rpx;
display: flex;
margin: 0;
.integra-title-tips {
background-color: green;
color: #fff;
width: 40rpx;
height: 40rpx;
line-height: 38rpx;
text-align: center;
border-radius: 50%;
margin-right: 10rpx;
font-size: 24rpx;
transform: scale(0.8);
&.active {
background-color: red;
}
}
}
.integra-oints {
color: green;
&.active {
color: red;
}
}
}
.integra-remark {
margin-bottom: 20rpx;
font-size: 26rpx;
color: #4e4e4e;
background: #f5f5f5;
display: inline-block;
padding: 6rpx 20rpx;
border-radius: 50rpx;
}
.integra-date {
display: flex;
}
}
.pages-hint {
margin: 20rpx;
border-radius: 10rpx;
}
</style>

View File

@@ -0,0 +1,298 @@
<template>
<view>
<view class="balance">
<image class="balanceBack" src="https://card.ysd-bs.com/storage/materials/2021/09/01/balance-back.png" mode="widthFix"></image>
<view class="balanceCont">
<view class="balanceCont-name">余额积分</view>
<view class="balanceCont-number">
<text></text>{{ number }}
</view>
</view>
<navigator hover-class="none" url="/pages/account/myProfit" class="balanceUrl">我的收益<image src="/static/img/balance-icon-row.png" mode="aspectFill"></image></navigator>
</view>
<navigator hover-class="none" url="/pages/account/withdrawal_form" class="label">
<view class="labelLeft">
<image class="labelLeft-img" src="/static/img/balance-icon-00.png"></image>
<view class="labelLeft-name">提现</view>
</view>
<image class="labelLeft-arrow" src="/static/icon/rightsArrow.png"></image>
</navigator>
<navigator hover-class="none" :url="'/pages/account/withdrawal_record?status=' + '' + '&idx=0'" class="label">
<view class="labelLeft">
<image class="labelLeft-img" src="/static/img/balance-icon-01.png"></image>
<view class="labelLeft-name">提现记录</view>
</view>
<image class="labelLeft-arrow" src="/static/icon/rightsArrow.png"></image>
</navigator>
<!-- 收益订单列表 -->
<view class="record">
<view class="integra-cont-title">
<view class="record-title">收益订单列表</view>
</view>
<block v-if="accounts.length > 0">
<navigator hover-class="none" :url="'/pages/account/myBalance_list?id=' + item.order_id + '&type=' + item.order_type" class="record-list" v-for="(item, index) in accounts" :key="index">
<view class="accounts-title">{{ item.right }}</view>
<view class="accounts-user">
<image class="accounts-user-icon" src="/static/img/accountsIcon_00.png"></image>
<view class="accounts-user-name"><text>{{ item.user.nickname }}</text>{{ item.user.username }}</view>
</view>
<view class="accounts-user">
<image class="accounts-user-icon" src="/static/img/accountsIcon_01.png"></image>
<view class="accounts-user-name">{{ item.created_at }}</view>
</view>
<view class="accounts-more"><image src="/static/icon/arrow_tips.png"></image></view>
</navigator>
<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>
</block>
<!-- 暂无内容 -->
<view class="recommend-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</view>
</template>
<script>
import { logs, profits } from '@/apis/interfaces/user'
export default {
data() {
return {
number : '', // 账户余额
accounts : '', // 账户列表
page: {
has_more: false
}, // 下一页
lodingStats: false // 数据加载完渲染
}
},
onLoad() {
// 获取余额数量
logs({
type : 'balance',
channel : '',
page : ''
}).then(res=>{
this.number = res.account.balance
})
},
onShow() {
// 获取账变记录
this.accountInfo();
},
methods: {
// 获取余额数量
accountInfo(page) {
profits({
page : page
}).then(res=>{
let newStores = this.accounts,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.data)
this.accounts = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
})
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.page = pageNumber
this.storesInfo('', pageNumber)
}
}
}
}
</script>
<style lang="scss" scoped>
/* 背景 */
.balance {
position: relative;
}
.balanceBack {
width: 100vw;
display: block;
}
.balanceCont {
position: absolute;
width: 100%;
left: 0;
top: 0;
text-align: center;
padding: 70rpx 0 0;
box-sizing: border-box;
}
.balanceCont-name {
color: #717171;
margin-bottom: 20rpx;
}
.balanceCont-number {
color: #ffd890;
font-size: 80rpx;
font-weight: 600;
}
.balanceCont-number text {
font-size: 50rpx;
padding-right: 10rpx;
}
.balanceUrl {
position: absolute;
right: 0;
top: 30rpx;
background-color: #37332d;
font-size: 28rpx;
border-radius: 40rpx 0 0 40rpx;
line-height: 68rpx;
border: 2rpx solid #887351;
padding-left: 30rpx;
color: #ead2a5;
display: flex;
}
.balanceUrl image {
width: 54rpx;
height: 54rpx;
margin-top: 9rpx;
}
/* 提现 */
.label {
background-color: white;
margin-bottom: 30rpx;
display: flex;
height: 100rpx;
line-height: 100rpx;
}
.labelLeft {
display: flex;
flex: 1;
}
.labelLeft-img {
width: 54rpx;
height: 54rpx;
margin: 23rpx 20rpx;
}
.labelLeft-arrow {
width: 44rpx;
height: 44rpx;
margin: 28rpx 0;
}
/* 账变记录 */
.record-title {
padding: 0 30rpx;
box-sizing: border-box;
color: #404040;
font-weight: 600;
font-size: 36rpx;
line-height: 60prx;
margin: 40rpx 0 30rpx;
flex: 1;
}
.record-list {
background-color: #ffffff;
margin-bottom: 50rpx;
padding: 0 30rpx 20rpx 30rpx;
box-sizing: border-box;
border-top: 2rpx solid #e9e9e9;
border-bottom: 2rpx solid #e9e9e9;
position: relative;
}
.accounts-more {
position: absolute;
bottom: -20rpx;
left: calc(50% - 40rpx);
width: 80rpx;
height: 40rpx;
text-align: center;
border-radius: 10rpx;
z-index: 9;
background-color: #ffffff;
border: #e9e9e9 2rpx solid;
}
.accounts-more image {
width: 28rpx;
height: 28rpx;
margin: 8rpx 26rpx;
}
.accounts-title {
position: relative;
padding: 30rpx 0 30rpx 35rpx;
}
.accounts-title::after {
position: absolute;
content: '';
left: 6rpx;
top: 37%;
width: 8rpx;
height: 30%;
background-color: #000000;
}
.accounts-user {
color: #838383;
display: flex;
border-top: 2rpx solid #f5f5f5;
padding: 30rpx 0;
}
.accounts-user text {
display: block;
margin-bottom: 20rpx;
}
.accounts-user-icon {
width: 36rpx;
height: 36rpx;
margin-right: 20rpx;
margin-top: 4rpx;
}
/* 暂无内容 */
.recommend-hint {
text-align: center;
color: #999;
padding: 100rpx 0;
}
.recommend-hint image {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
</style>

View File

@@ -0,0 +1,155 @@
<template>
<view>
<!-- 收益订单列表 -->
<view class="record" v-if="accounts.length > 0">
<view class="record-list" v-for="(item, index) in accounts" :key="index">
<view class="record-list-cont">
<image class="record-list-img" src="/static/img/balance-icon-02.png"></image>
<view class="record-list-top">
<view class="record-list-left">
<view class="record-list-name">
{{ item.rule.title }}
</view>
<view class="record-list-time">
{{ item.created_at }}
</view>
</view>
<view class="record-list-right">
{{ item.bonus > 0 ? '+' : '' }}{{ item.bonus }}
</view>
</view>
</view>
<view class="record-list-remark">
{{ item.remark }}
</view>
</view>
</view>
<!-- 暂无内容 -->
<view class="recommend-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</template>
<script>
import { profitsNext } from '@/apis/interfaces/user'
export default {
data() {
return {
number : '', // 账户余额
accounts : '', // 账户列表
page: {
has_more: false
}, // 下一页
lodingStats: false // 数据加载完渲染
}
},
onLoad(options) {
// 获取账变记录
this.accountInfo(options.type, options.id);
},
methods: {
// 账变记录
accountInfo(type, id, page) {
profitsNext({
order_type: type,
order_id: id,
page: page
}).then(res=>{
this.accounts = res
}).catch(err => {});
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.page = pageNumber
this.storesInfo('', pageNumber)
}
}
}
}
</script>
<style lang="scss" scoped>
/* 记录列表 */
.record-list {
background-color: #fff;
border-radius: 10rpx;
padding: 25rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
}
.record-list-img {
width: 50rpx;
height: 50rpx;
margin-top: 6rpx;
}
.record-list-cont {
display: flex;
width: 100%;
}
.record-list-top {
display: flex;
padding-left: 30rpx;
width: 100%;
box-sizing: border-box;
}
.record-list-left {
flex: 1;
margin-right: 20rpx;
}
.record-list-time {
margin-top: 10rpx;
font-size: 28rpx;
color: #999;
}
.record-list-right {
color: red;
}
.record-list-remark {
color: #333;
font-size: 28rpx;
margin: 30rpx 0 0;
background-color: #f5f5f5;
padding: 10rpx 15rpx;
display: inline-block;
border-radius: 4rpx;
position: relative;
box-sizing: border-box;
&::after {
position: absolute;
left: 20rpx;
top: -14rpx;
content: '';
width: 0;
height: 0;
border-left: 14rpx solid transparent;
border-right: 14rpx solid transparent;
border-bottom: 14rpx solid #f5f5f5;
}
}
/* 暂无内容 */
.recommend-hint {
text-align: center;
color: #999;
padding: 100rpx 0;
image {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,178 @@
<template>
<view>
<block v-if="publicData.length > 0">
<view class="record-list" v-for="(item, index) in publicData" :key="index">
<view class="record-top">
<view class="record-way">{{ item.name }}</view>
<view class="record-label-status">{{ item.bonus }}</view>
</view>
<view class="record-cont">
<view class="record-label">
<view class="record-label-name">时间</view>
<view class="record-label-time">{{ item.created_at }}</view>
</view>
<view class="record-label">
<view class="record-label-name">状态</view>
<view class="record-label-time">{{ item.order.status }}</view>
</view>
</view>
<view class="record-source">
<view class="record-source-name">收益来源</view>
<view class="record-source-cont">
<image class="record-source-img" :src="item.source.avatar" mode="aspectFill"></image>
<view class="record-source-info">
<view class="record-source-nickname">{{ item.source.nickname }}</view>
<view class="record-source-tel">{{ item.source.username }}</view>
</view>
</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>
</block>
<!-- 暂无内容 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉目前暂无记录~</view>
</view>
</view>
</template>
<script>
import { profitLogs } from '@/apis/interfaces/user'
export default {
data() {
return {
name : '', //权益名
publicData : [], //权益列表
page : {}, //下一页
lodingStats : false ,//加载状态
}
},
onLoad(options) {
this.name = options.name
// 获取收益列表
this.profitInfo();
},
methods: {
// 收益列表
profitInfo(page) {
profitLogs({
name: this.name,
page: page
}).then(res=>{
let listArr = this.publicData,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.publicData = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err=>{})
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.profitInfo(pageNumber)
}
}
}
}
</script>
<style lang="scss" scoped>
/* 记录列表 */
.record-list {
background-color: #fff;
border-radius: 10rpx;
margin: 30rpx;
}
.record-top {
display: flex;
padding: 30rpx;
box-sizing: border-box;
}
.record-way {
flex: 1;
}
.record-take {
font-weight: 600;
}
.record-cont {
padding: 0 30rpx;
box-sizing: border-box;
color: #999;
font-size: 28rpx;
}
.record-label {
display: flex;
line-height: 70rpx;
}
.record-label-name {
flex: 1;
}
.record-label-status {
color: red;
}
.record-source {
border-top: 10rpx solid #f7f7f7;
margin-top: 20rpx;
}
.record-source-name {
background: #f7f7f7;
color: #000;
width: 140rpx;
text-align: center;
line-height: 60rpx;
margin: 0 auto;
font-size: 28rpx;
}
.record-source-cont {
position: relative;
padding: 40rpx 30rpx 20rpx;
box-sizing: border-box;
}
.record-source-img {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
}
.record-source-info {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 40rpx 30rpx 20rpx 120rpx;
box-sizing: border-box;
line-height: 70rpx;
display: flex;
}
.record-source-nickname {
flex: 1;
}
</style>

View File

@@ -0,0 +1,28 @@
<template>
<view>
</view>
</template>
<script>
import { create, store } from '@/apis/interfaces/recharge'
export default {
data() {
return {
}
},
onLoad(options) {
// 获取充值列表
create().then(res=>{
})
},
onShow() {
},
methods:{
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,167 @@
<template>
<view>
<view class="withdrawal">
<image class="withdrawal-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/withdrawal_icon.png"></image>
<view class="withdrawal-price">{{ balance }}</view>
<view class="withdrawal-name">我的账户余额</view>
</view>
<view class="withdrawalTips">
当前现金金额低于2元不可提现每次提现的额度不低于2元提现手续费按照到账周期收取
</view>
<view class="withdrawalForm">
<form @submit="formSubmit">
<view class="withdrawalForm-label">
<view class="withdrawalForm-label-name">提现金额</view>
<input type="digit" :value="amount" placeholder="请输入提现金额" @input="getAmount" />
</view>
<view class="withdrawalForm-label">
提现费用收取手续费{{ tax }}%
</view>
<button class="withdrawalForm-btn" formType="submit" :disabled="disabled">立即提现</button>
<navigator class="withdrawalForm-url" hover-class="none" :url="'/pages/account/withdrawal_record?status=' + '' + '&idx=0'">提现记录</navigator>
</form>
</view>
</view>
</template>
<script>
import { withdraws, withdrawsForm } from '@/apis/interfaces/user'
export default {
data() {
return {
balance : '', //余额
tax : '', //手续费
amount : '', //提现金额
disabled : false //按钮状态
}
},
onLoad(options) {
// 获取提现前置账户信息
this.withdrawsInfo();
},
methods: {
// 提现前置账户信息
withdrawsInfo() {
withdraws().then(res=>{
this.balance = res.balance
this.tax = res.tax
}).catch(err=>{})
},
// 获取提现金额
getAmount (val) {
var money;
if (/^(\d?)+(\.\d{0,1})?$/.test(val.detail.value)) { //正则验证,提现金额小数点后不能大于两位数字
money = val.detail.value;
} else {
money = val.detail.value.substring(0, val.detail.value.length - 1);
}
this.amount = money
},
// 提现表单填写
formSubmit(e) {
let newAmount = this.amount
if(newAmount > 1) {
withdrawsForm({
amount: newAmount,
channel: "mini"
}).then(res=>{
this.disabled = true
uni.showToast({
title: '提现申请提交成功',
})
setTimeout(()=>{
uni.redirectTo({
url: "/pages/account/withdrawal_record?status=''&idx=0"
})
},2000)
}).catch(err=>{})
}else {
uni.showToast({
title: '金额不得低于2元',
icon: 'none'
})
}
}
}
}
</script>
<style lang="scss" scoped>
/* 余额 */
.withdrawal{
background-color: #fff;
text-align: center;
padding: 30rpx 0;
}
.withdrawal-img {
width: 180rpx;
height: 180rpx;
}
.withdrawal-price {
color: #df0000;
font-size: 50rpx;
margin: 10rpx 0;
}
.withdrawal-name {
font-size: 28rpx;
color: #666666;
}
.withdrawalTips {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #b9c6d2;
}
.withdrawalForm-label {
background-color: #fff;
margin-bottom: 30rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
display: flex;
input {
background-color: transparent;
padding-left: 50rpx;
box-sizing: border-box;
}
}
.withdrawalForm-btn {
background-color: #ff6d6d;
width: calc(100% - 40rpx) !important;
color: #fff;
height: 90rpx !important;
line-height: 90rpx !important;
padding: 0;
margin-top: 40rpx;
font-size: 32rpx;
}
.withdrawalForm-url {
text-align: center;
width: 100%;
margin-top: 20rpx;
position: relative;
color: #ff6d6d;
&::after {
position: absolute;
content: '';
left: calc(50% - 60rpx);
bottom: 0rpx;
width: 120rpx;
height: 4rpx;
background-color: #ff6d6d;
}
}
</style>

View File

@@ -0,0 +1,203 @@
<template>
<view>
<view class="profigOrder-module-title">
<view class="profigOrder-module-name">
提现列表
</view>
<view class="profigReport-module-picker">
<picker @change="screenWithdrawal" :value="WithdrawalIndex" :range-key="'name'" :range="WithdrawalWay">
{{ WithdrawalWay[WithdrawalIndex].name }}
</picker>
<image class="profigReport-module-icon" src="/static/icon/arrow_down.png"></image>
</view>
</view>
<view v-if="accounts.length > 0" class="recordCont">
<view class="record-list" v-for="(item, index) in accounts" :key="index">
<view class="record-top">
<view class="record-way">{{ item.way }}</view>
<view class="record-take">+{{ item.take }}</view>
</view>
<view class="record-cont">
<view class="record-label">
<view class="record-label-name">提现时间</view>
<view class="record-label-time">{{ item.create_at }}</view>
</view>
<view class="record-label">
<view class="record-label-name">提现状态</view>
<view class="record-label-status" :class="{'record-label-green' : item.status.status == 3}">
{{ item.status.status_text }}
</view>
</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>
</view>
<!-- 暂无内容 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/legal_tips.png"></image>
<view>抱歉目前暂无记录~</view>
</view>
</view>
</template>
<script>
import { withdrawsList } from '@/apis/interfaces/user'
export default {
data() {
return {
accounts : [], // 列表
page : {}, // 分页信息
lodingStats : false, // 加载状态
WithdrawalWay : [
{value: '', name: "全部", status: ''},
{value: 0, name: "提现中", status: 'init'},
{value: 1, name: "已提现", status: 'end'}
],
WithdrawalIndex : 0, // 收益订单筛选列表index
WithdrawalValue : 'init' // 收益订单筛选列表value
}
},
onLoad(options) {
this.WithdrawalValue = options.status
this.WithdrawalIndex = parseInt(options.idx)
},
onShow() {
// 获取提现列表
this.recordInfo();
},
methods: {
// 提现列表
recordInfo(page) {
withdrawsList({
status: this.WithdrawalValue,
page: page
}).then(res=>{
let listArr = this.accounts,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.accounts = newData
this.page = res.page
}).catch(err => {});
},
// 团队类型选择
screenWithdrawal(val) {
this.WithdrawalIndex = val.detail.value
this.WithdrawalValue = this.WithdrawalWay[val.detail.value].status
// 获取提现列表
this.recordInfo();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取提现列表
this.recordInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 获取提现列表
this.recordInfo(pageNumber);
}
}
}
}
</script>
<style lang="scss" scoped>
/* 记录列表 */
.record-list {
background-color: #fff;
border-radius: 10rpx;
padding: 25rpx 25rpx 10rpx;
box-sizing: border-box;
margin: 30rpx;
}
.record-top {
display: flex;
}
.record-way {
flex: 1;
}
.record-take {
font-weight: 600;
}
.record-cont {
margin-top: 20rpx;
color: #999;
font-size: 28rpx;
}
.record-label {
display: flex;
line-height: 70rpx;
}
.record-label-name {
flex: 1;
}
.record-label-status {
color: red;
}
.record-label-status.record-label-green {
color: green;
}
.profigOrder-module-title {
position: fixed;
width: 100%;
left: 0;
top: 0;
z-index: 9;
background-color: #ffffff;
display: flex;
box-sizing: border-box;
height: 80rpx;
line-height: 80rpx;
margin-bottom: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.profigOrder-module-name {
font-weight: 600;
flex: 1;
}
.profigReport-module-picker {
display: flex;
color: #797979;
font-size: 28rpx;
padding-top: 4rpx;
}
.profigReport-module-icon {
width: 28rpx;
height: 28rpx;
margin: 26rpx 0 0 10rpx;
}
.recordCont {
margin-top: 110rpx;
}
</style>

View File

@@ -0,0 +1,196 @@
<template>
<view>
<!-- 卡激活 -->
<view class="activate-back">
<image class="activate-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/activate-back.jpg" mode="aspectFill"></image>
<view class="activate-cont">
<view class="activate-title">消费红包储值卡</view>
<form @submit="cardform" class="activate-form">
<view class="activate-label">
<label>输入激活卡号16 <text>Byt2020090800020</text></label>
<input maxlength="16" name="code"></input>
</view>
<view class="activate-label">
<label>输入激活卡密16 <text>8888 8888 8888 8888</text></label>
<input maxlength="19" type="pass" @input="carmiTab" :value="carmi"/>
</view>
<view class="activate-btn">
<button form-type="submit">立即激活</button>
</view>
</form>
<view class="activate-tips">
<view class="activate-tips-title">温馨提示</view>
<view class="activate-tips-text">
尊敬的会员储值后将开启您愉快的消费之旅
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { cards } from '@/apis/interfaces/auth'
export default {
data() {
return {
carmi: '' // 卡密
}
},
onLoad(options) {},
methods:{
// 卡激活
cardform(e) {
cards({
code: e.detail.value.code,
code: this.carmi
}).then(res=>{
// if(res.type == "silver") {
// app.globalData.userCurrent = 0
// }else if(res.type == "gold") {
// app.globalData.userCurrent = 1
// }else if(res.type == "drill") {
// app.globalData.userCurrent = 2
// }else {
// return
// }
// 写入缓存
// uni.setStorage({
// key : 'current',
// data : app.globalData.userCurrent
// })
uni.showToast({
title: res.message,
icon : 'none'
})
setTimeout(()=>{
uni.switchTab({
url: '/pages/user/index'
})
},2000)
})
},
// 获取卡密
carmiTab(e){
var number = e.detail.value
var change = number.replace(/(\d{4})(?=\d)/g, "$1-");
this.carmi = change
}
}
}
</script>
<style lang="scss" scoped>
/* 卡激活 */
.activate-back {
width: 100%;
height: 100vh;
left: 0;
top: 0;
position: relative;
.activate-img {
position: relative;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.activate-cont {
position: absolute;
top: 0;
left: 0;
padding: 60rpx;
width: 100%;
box-sizing: border-box;
z-index: 9;
.activate-title {
font-size: 60rpx;
font-weight: 600;
text-align: center;
margin: 20rpx 0 100rpx;
}
.activate-label, .activate-pass {
margin-bottom: 60rpx;
}
.activate-label label, .activate-pass label {
margin-bottom: 40rpx;
display: block;
font-weight: 600;
font-size: 34rpx;
}
.activate-label input, .activate-pass input {
background: rgba(255, 255, 255, .3);
border-radius: 60rpx;
height: 90rpx;
line-height: 90rpx;
padding: 0 1rem;
box-sizing: border-box;
box-shadow: inset -2px 2px 4px 1.5px rgba(0, 0, 0, 0.7);
}
.activate-label input {
width: 100%;
}
.activate-label text {
display: block;
font-size: 32rpx;
margin-top: 10rpx;
font-weight: normal;
}
.activate-entry {
display: flex;
line-height: 80rpx;
color: #fff;
font-weight: 600;
input {
background: #fff;
border-radius: 60rpx;
width: calc(25% - 1rem);
margin: 0 .5rem;
height: 80rpx;
line-height: 80rpx;
}
}
.activate-btn {
width: 100%;
height: 90rpx;
border: none;
margin: 2rem 0 2.2rem;
button {
width: 100% !important;
height: 100%;
line-height: 90rpx;
border-radius: 50rpx;
background: #000;
border: none;
font-size: 40rpx;
color: #fff;
margin: 0;
padding: 0;
}
}
.activate-tips {
color: #000;
font-weight: 600;
font-size: 32rpx;
.activate-tips-text {
line-height: 46rpx;
margin-top: 20rpx;
}
.activate-tips-img {
width: 240rpx;
height: 240rpx;
border-radius: 50%;
margin: 2rem auto 0;
image {
width: 100%;
height: 100%;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,277 @@
<template>
<view>
<image class="loginBack" src="/static/img/login_back.png" mode="aspectFill"></image>
<view class="login">
<view class="header">
<view class="header-btn" @click="loginBack">
<uni-icons type="closeempty" size="28" color="#666"></uni-icons>
</view>
</view>
<view class="title">
<image class="title-logo" src="../../static/img/logo.png" mode="aspectFill"></image>
<view class="title-name">欢迎使用本时生活</view>
</view>
<view class="form">
<view class="inputs">
<input type="number" v-model="phone" @input="getNameValue" placeholder="输入手机号码" />
</view>
<view class="inputs">
<input type="number" @input="getCodeValue" :value="code" placeholder="输入手机验证码" />
<button type="default" @click="getCode" :disabled="disabled">
{{ codename }}
</button>
</view>
<button
type="default"
class="button"
:disabled="phone.length <= 0 || code.length <= 0"
@click="forgetlogin"
>登录</button>
<view class="login-wechat">
<navigator hover-class="none" url="/pages/auth/password_login" class="login-wechat-btn">
密码登录
</navigator>
<navigator hover-class="none" url="/pages/auth/register" class="login-wechat-btn login-register">
账户注册
</navigator>
</view>
</view>
</view>
</view>
</template>
<script>
import { auth, send } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
phone : '', // 手机号
code : '', // 验证码
disabled : false ,// 按钮状态
way : '' // 登录方式-活动
};
},
onLoad(options){
// 登录方式-活动
this.way = options.way
},
onUnload() {},
methods:{
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.phone,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({
mobile : mobileNo,
channel: 'LOGIN'
}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// forgetlogin
forgetlogin(e){
uni.showLoading({
title: '登录中...'
})
auth({
mobile: this.phone,
code: this.code,
type: ''
}).then(res=>{
// 清空分享信息
if(this.way == 'shareLogin'){
getApp().globalData.shareObj = {
type : '',
goodsId : '',
userId : ''
}
}
// 存储登录token
this.$store.commit('setToken', res.token)
uni.hideLoading()
// 若没有登录密码则跳转设置登录密码页面
if(res.has_password == false) {
uni.redirectTo({
url: '/pages/auth/password'
})
return
}
// 设置过登录密码,则跳到首页
uni.switchTab({
url: '/pages/index/index'
})
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style>
page{
background-color: white;
}
</style>
<style lang="scss" scoped>
.loginBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.login{
width: 100%;
z-index: 2;
padding: var(--status-bar-height) 20rpx * 4 0;
box-sizing: border-box;
position: fixed;
top: 140rpx;
left: 0;
.header{
padding: (20rpx * 2) 0 (20rpx * 5);
.header-btn{
display: none;
height: 90rpx;
width: 90rpx;
line-height: 90rpx;
text-align: center;
margin-left: -30rpx;
}
}
.title {
margin-bottom: 20rpx * 5;
font-size: 30rpx;
font-weight: bold;
text-align: center;
color: #000;
.title-logo {
width: 160rpx;
height: 160rpx;
margin-bottom: 20rpx;
}
}
// 表单
.form{
.inputs{
margin-bottom: 20rpx * 2;
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: .2);
border-radius: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
display: flex;
input {
flex: 1;
height: 90rpx;
font-size: 30rpx;
}
button{
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
background: white;
color: #188600;
margin-left: 20rpx;
background: transparent;
padding: 0;
&:after{
border: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.button{
margin-top: 20rpx * 4;
background: #000000;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: 80rpx;
font-size: 30rpx;
font-weight: bold;
border: none;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .7);
&[disabled]{
background: #c1c1c1;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .1);
}
}
}
// 微信快捷登录
.login-wechat{
position: fixed;
width: 100%;
left: 0;
bottom: 0;
height: 140rpx;
display: flex;
padding: 0 100rpx;
box-sizing: border-box;
.login-wechat-btn {
width: 50%;
display: inline-block;
}
.login-register {
text-align: right;
}
}
}

View File

@@ -0,0 +1,170 @@
<template>
<view>
<view @click="homeUrl" class="skip" v-if="type != 'forgetType'">
跳过暂不设置
</view>
<view class="login">
<view class="header">
<view class="header-btn" @click="loginBack">
<uni-icons type="closeempty" size="28" color="#666"></uni-icons>
</view>
</view>
<view class="title">
设置登录密码
</view>
<view class="form">
<view class="inputs">
<input type="number" v-model="password" password placeholder="输入登录密码" />
</view>
<view class="inputs">
<input type="number" v-model="confirmation" password placeholder="再次输入登录密码" />
</view>
<button
type="default"
class="button"
@click="setupGo"
>确定</button>
</view>
</view>
</view>
</template>
<script>
import { passSetup } from '@/apis/interfaces/auth'
export default {
data() {
return {
password : '', // 设置密码
confirmation: '', // 确认密码
type : '' // 类型
};
},
onLoad(e){
this.type = e.type
},
methods:{
// 设置登录密码
setupGo() {
passSetup({
password: this.password,
password_confirmation: this.confirmation
}).then(res=>{
uni.switchTab({
url: '/pages/index/index'
})
}).catch(err => {
uni.showToast({
icon: 'none',
title: err.message
})
})
},
// 跳转首页
homeUrl() {
uni.switchTab({
url: '/pages/index/index'
})
}
}
}
</script>
<style>
page{
background-color: #f0f0f0;
}
</style>
<style lang="scss" scoped>
.loginBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.login{
width: 100%;
z-index: 2;
padding: var(--status-bar-height) 20rpx * 4 0;
box-sizing: border-box;
position: fixed;
top: 100rpx;
left: 0;
.header{
padding: (20rpx * 2) 0 (20rpx * 5);
.header-btn{
display: none;
height: 90rpx;
width: 90rpx;
line-height: 90rpx;
text-align: center;
margin-left: -30rpx;
}
}
.title {
margin-bottom: 20rpx * 5;
font-size: 40rpx;
font-weight: bold;
color: #000;
}
// 表单
.form{
.inputs{
background-color: #FFFFFF;
margin-bottom: 20rpx * 2;
border-radius: 10rpx;
padding: 0 30rpx;
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
display: flex;
input {
flex: 1;
height: 90rpx;
font-size: 30rpx;
}
button{
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
background: white;
color: #188600;
margin-left: 20rpx;
background: transparent;
padding: 0;
&:after{
border: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.button{
margin-top: 20rpx * 4;
background: #d82d36;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
font-size: 32rpx;
font-weight: bold;
border: none;
}
}
}
// 跳过
.skip {
position: fixed;
top: 0;
right: 0;
width: 100%;
text-align: right;
padding: 30rpx;
font-size: 28rpx;
box-sizing: border-box;
z-index: 99;
color: #7b7b7b;
}

View File

@@ -0,0 +1,203 @@
<template>
<view>
<image class="loginBack" src="/static/img/login_back.png" mode="aspectFill"></image>
<view class="login">
<view class="header">
<view class="header-btn" @click="loginBack">
<uni-icons type="closeempty" size="28" color="#666"></uni-icons>
</view>
</view>
<view class="title">
<image class="title-logo" src="../../static/img/logo.png" mode="aspectFill"></image>
<view class="title-name">欢迎使用本时生活</view>
</view>
<view class="form">
<view class="inputs">
<input type="number" v-model="mobile" @input="mobileValue" placeholder="输入手机号码" />
</view>
<view class="inputs">
<input type="number" v-model="password" @input="passwordValue" password placeholder="输入登录密码" />
</view>
<button
type="default"
class="button"
:disabled="mobile.length <= 0 || password.length <= 0"
@click="forgetlogin"
>登录</button>
<navigator class="forgetTips" url="/pages/auth/psssword_forget" hover-class="none">忘记密码</navigator>
<view class="login-wechat">
<navigator hover-class="none" url="/pages/auth/login" class="login-wechat-btn">
短信快捷登录
</navigator>
<navigator hover-class="none" url="/pages/auth/register" class="login-wechat-btn login-register">
账户注册
</navigator>
</view>
</view>
</view>
</view>
</template>
<script>
import { passlogin } from '@/apis/interfaces/auth'
export default {
data() {
return {
mobile : '', // 手机号
password : '', // 登录密码
disabled : false // 按钮状态
};
},
onLoad(e){
},
onUnload() {},
methods:{
// mobileNo
mobileValue(e) {
this.mobile = e.detail.value
},
// passwordNo
passwordValue(e) {
this.password = e.detail.value
},
// forgetlogin
forgetlogin(e){
uni.showLoading({
title: '登录中...'
})
passlogin({
mobile: this.mobile,
password: this.password
}).then(res=>{
// 存储登录token
this.$store.commit('setToken', res.token)
uni.hideLoading()
// 若没有登录密码则跳转设置登录密码页面
if(res.has_password == false) {
uni.redirectTo({
url: '/pages/auth/password'
})
return
}
// 设置过登录密码,则跳到首页
uni.switchTab({
url: '/pages/index/index'
})
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style>
page{
background-color: white;
}
</style>
<style lang="scss" scoped>
.loginBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.login{
width: 100%;
z-index: 2;
padding: var(--status-bar-height) 20rpx * 4 0;
box-sizing: border-box;
position: fixed;
top: 140rpx;
left: 0;
.header{
padding: (20rpx * 2) 0 (20rpx * 5);
.header-btn{
display: none;
height: 90rpx;
width: 90rpx;
line-height: 90rpx;
text-align: center;
margin-left: -30rpx;
}
}
.title {
margin-bottom: 20rpx * 5;
font-size: 30rpx;
font-weight: bold;
text-align: center;
color: #000;
.title-logo {
width: 160rpx;
height: 160rpx;
margin-bottom: 20rpx;
}
}
// 表单
.form{
.inputs{
margin-bottom: 20rpx * 2;
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: .2);
border-radius: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
display: flex;
input {
flex: 1;
height: 90rpx;
font-size: 30rpx;
}
}
.button {
margin-top: 20rpx * 4;
background: #000000;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: 80rpx;
font-size: 30rpx;
font-weight: bold;
border: none;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .7);
&[disabled]{
background: #c1c1c1;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .1);
}
}
}
// 微信快捷登录
.forgetTips {
text-align: right;
margin-top: 10px;
}
// 微信快捷登录
.login-wechat{
position: fixed;
width: 100%;
left: 0;
bottom: 0;
height: 140rpx;
display: flex;
padding: 0 100rpx;
box-sizing: border-box;
.login-wechat-btn {
width: 50%;
display: inline-block;
}
.login-register {
text-align: right;
}
}
}

View File

@@ -0,0 +1,198 @@
<template>
<view>
<view class="login">
<view class="title">
身份验证
</view>
<view class="form">
<form @submit="forgetlogin">
<view class="inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="inputs">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<button class="button" form-type="submit">找回</button>
</form>
</view>
</view>
</view>
</template>
<script>
import { send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
};
},
onLoad(e){},
methods:{
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]||16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || ''
auth({
mobile: mobileNo,
code: code,
type: 'reset_password'
}).then(res => {
this.$store.commit('setToken', res.token)
uni.redirectTo({
url: '/pages/auth/password?type=forgetType'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style>
page{
background-color: #f0f0f0;
}
</style>
<style lang="scss" scoped>
.loginBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.login{
width: 100%;
z-index: 2;
padding: var(--status-bar-height) 20rpx * 4 0;
box-sizing: border-box;
position: fixed;
top: 100rpx;
left: 0;
.header{
padding: (20rpx * 2) 0 (20rpx * 5);
.header-btn{
display: none;
height: 90rpx;
width: 90rpx;
line-height: 90rpx;
text-align: center;
margin-left: -30rpx;
}
}
.title {
margin-bottom: 20rpx * 5;
font-size: 40rpx;
font-weight: bold;
color: #000;
}
// 表单
.form{
.inputs{
background-color: #FFFFFF;
margin-bottom: 20rpx * 2;
border-radius: 10rpx;
padding: 0 30rpx;
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
display: flex;
input {
flex: 1;
height: 90rpx;
font-size: 30rpx;
}
button{
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
background: white;
color: #188600;
margin-left: 20rpx;
background: transparent;
padding: 0;
&:after{
border: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.button{
margin-top: 20rpx * 4;
background: #d82d36;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
font-size: 32rpx;
font-weight: bold;
border: none;
}
}
}

View File

@@ -0,0 +1,286 @@
<template>
<view>
<image class="loginBack" src="/static/img/login_back.png" mode="aspectFill"></image>
<view class="login">
<view class="header">
<view class="header-btn" @click="loginBack">
<uni-icons type="closeempty" size="28" color="#666"></uni-icons>
</view>
</view>
<view class="title">
<image class="title-logo" src="../../static/img/logo.png" mode="aspectFill"></image>
<view class="title-name">欢迎使用本时生活</view>
</view>
<view class="form">
<view class="inputs">
<input type="number" v-model="mobile" @input="getNameValue" placeholder="输入手机号码" />
</view>
<view class="inputs">
<input type="number" v-model="password" @input="passwordValue" password placeholder="输入登录密码" />
</view>
<view class="inputs">
<input type="number" v-model="confirmation" @input="confirValue" password placeholder="确认登录密码" />
</view>
<view class="inputs">
<input type="number" @input="getCodeValue" :value="code" placeholder="输入手机验证码" />
<button type="default" @click="getCode" :disabled="disabled">
{{ codename }}
</button>
</view>
<button
type="default"
class="button"
:disabled="mobile.length <= 0 || password.length <= 0 || confirmation.length <= 0 || code.length <= 0"
@click="forgetlogin"
>立即注册</button>
<view class="login-wechat">
<navigator hover-class="none" url="/pages/auth/login" class="login-wechat-btn">
短信快捷登录
</navigator>
<navigator hover-class="none" url="/pages/auth/password_login" class="login-wechat-btn login-register">
密码登录
</navigator>
</view>
</view>
</view>
</view>
</template>
<script>
import { register, send } from '@/apis/interfaces/auth'
export default {
data() {
return {
parentId : '', // 推荐人id
codename : '获取验证码',
password : '', // 登录密码
confirmation: '', // 确认登录密码
mobile : '', // 手机号
code : '', // 验证码
disabled : false // 按钮状态
};
},
onLoad(e){
},
onUnload() {},
methods:{
// mobileNo
getNameValue(e) {
this.mobile = e.detail.value
},
// passwordNo
passwordValue(e) {
this.password = e.detail.value
},
// confirmationNo
confirValue(e) {
this.confirmation = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobile,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({
mobile : mobileNo,
channel: 'LOGIN'
}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// forgetlogin
forgetlogin(){
uni.showLoading({
title: '注册中...'
})
register({
mobile: this.mobile,
password: this.password,
password_confirmation: this.confirmation,
code: this.code,
parent_id: ''
}).then(res=>{
// 存储登录token
this.$store.commit('setToken', res.token)
uni.hideLoading()
// 若没有登录密码则跳转设置登录密码页面
if(res.has_password == false) {
uni.redirectTo({
url: '/pages/auth/password'
})
return
}
// 设置过登录密码,则跳到首页
uni.switchTab({
url: '/pages/index/index'
})
}).catch(err=>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style>
page{
background-color: white;
}
</style>
<style lang="scss" scoped>
.loginBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
}
.login{
width: 100%;
z-index: 2;
padding: var(--status-bar-height) 20rpx * 4 0;
box-sizing: border-box;
position: relative;
top: 0;
left: 0;
.header{
padding: (20rpx * 2) 0 (20rpx * 5);
.header-btn{
display: none;
height: 90rpx;
width: 90rpx;
line-height: 90rpx;
text-align: center;
margin-left: -30rpx;
}
}
.title {
margin-bottom: 20rpx * 5;
font-size: 30rpx;
font-weight: bold;
text-align: center;
color: #000;
.title-logo {
width: 160rpx;
height: 160rpx;
margin-bottom: 20rpx;
}
}
// 表单
.form{
.inputs{
margin-bottom: 20rpx * 2;
box-shadow: 0 0 10rpx rgba($color: #000000, $alpha: .2);
border-radius: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
display: flex;
input {
flex: 1;
height: 90rpx;
font-size: 30rpx;
}
button{
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
background: white;
color: #188600;
margin-left: 20rpx;
background: transparent;
padding: 0;
&:after{
border: none;
}
&[disabled]{
color: #C8C7CC;
}
}
}
.button{
margin-top: 20rpx * 4;
background: #000000;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: 80rpx;
font-size: 30rpx;
font-weight: bold;
border: none;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .7);
&[disabled]{
background: #c1c1c1;
box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: .1);
}
}
}
// 微信快捷登录
.login-wechat{
position: fixed;
width: 100%;
left: 0;
bottom: 0;
height: 140rpx;
display: flex;
padding: 0 100rpx;
box-sizing: border-box;
.login-wechat-btn {
width: 50%;
display: inline-block;
}
.login-register {
text-align: right;
}
}
}

View File

@@ -0,0 +1,680 @@
<template>
<view>
<!-- 按钮 -->
<view class="newrightsBtn" @tap="payment">
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">{{ rightData.num }}件商品 </view>
<view>实付<text>{{ rightData.total }}</text></view>
</view>
<button :disabled="disabled">立即购买</button>
</view>
<!-- 卡券 -->
<view style="padding-bottom: 90px">
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://lifetest.ysd-bs.com/storage/materials/2021/08/09/class_back_02.png" mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont">
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" v-for="(item, index) in rightData.detail.logos" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
</scroll-view>
<view class="nowrap rightsCont-btn">
{{ rightData.detail.four_title }}
</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="rightsNumber">
<image class="rightsGoods-img" :src="rightData.detail.goods_cover" mode="aspectFill"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{ rightData.detail.five_title }}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number"><text></text>{{ rightData.detail.price }}</view>
<view class="rightsAdd">
<view class="rightsAdd-btn rightsAdd-remove" :class="{active : rightData.num != 1}" @click="goodsNumber('remove')">-</view>
<input class="rightsAdd-input" :data-num="rightData.num" :value="rightData.num" type="number" disabled=""></input>
<view class="rightsAdd-btn rightsAdd-plus" @click="goodsNumber('plus')">+</view>
</view>
</view>
</view>
</view>
<!-- 收货地址 -->
<block v-if="buyWay.platformCp[buyWay.platIndex]">
<view class="rightsList" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<block v-if="rightData.detail.type == 'physical'">
<view class="rightsLabel">
<view class="rightsLabel-left">提交方式</view>
<view class="rightsLabel-right rightsLabel-range">
<picker :value="buyWay.platIndex" :range-key="'name'" :range="buyWay.platformCp" range-key="name" @change="platBind">
<view class="tabs-text">
{{ buyWay.platformCp[buyWay.platIndex].name }}
</view>
</picker>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</view>
<view class="rightsLabel rightsLabel-address" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<image class="rightsLabel-icon" src="/static/img/new_rightsAddress.png"></image>
<block v-if="rightData.addressSee != ''">
<view class="rightsLabel-right" @tap="addressTap">
<view class="rightsLabel-address-text">
<view class="rightsLabel-address-name">{{ rightData.addressSee.name }}<view class="rightsLabel-address-tel">{{ rightData.addressSee.mobile }}</view></view>
<text class="nowrap">{{ rightData.addressSee.all_address }}</text>
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</block>
<block v-else>
<navigator class="rightsLabel-right" hover-class="none" url="/pages/address_form/address_form?type=Add">
<view class="rightsLabel-address-text" style="line-height: 90rpx;">
添加收货地址
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</navigator>
</block>
</view>
<view class="rightsLabel" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<view class="rightsLabel-left">快递运费</view>
<view class="rightsLabel-right rightsLabel-freight">{{ rightData.freight }}</view>
</view>
</block>
</view>
</block>
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @click="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读使用须知内容介绍
</view>
<image class="noticeTitle-row" :class="{active : notice.noticeShow}" src="/static/icon/rightsArrow.png"></image>
</view>
<view class="noticeText" :class="{active : notice.noticeShow}">
<view class="noticeText-top">购买须知</view>
<view class="noticeText-cont" v-if="notice.remark">
<rich-text :nodes="notice.remark"></rich-text>
</view>
<view class="noticeText-top">内容介绍</view>
<view class="noticeText-cont" v-if="notice.content">
<rich-text :nodes="notice.content"></rich-text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { buy, buySubmit } from '@/apis/interfaces/campus'
export default {
data() {
return {
rightData: {
detail : '', // 权益内容
rightId : '', // 权益id
addressSee : '', // 收货地址
num : 1, // 购买数量
moreAmount : '', // 产品总金额
freight : '', // 运费
total : '' // 总金额
},
notice : {
remark : '', // 购买须知
content : '', // 内容介绍
noticeShow : true // 购买须知状态
},
buyWay : {
platformCp : [], // 选择提交数组
platIndex : 0, // 选择提交方式下标
isdeliver : -1 // 选择提交方式
},
address : {
allAddress : [], // 收货地址列表
addressShow : false // 地址显示状态
},
disabled : false, //购买按钮状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.rightData.rightId = options.id
// this.code = options.code || ''
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-校园迎新活动
getApp().globalData.envType = 'campusEnv'
// 获取详情
this.rightsInfo();
},
methods: {
// 详情
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=>{
return { ...obj[val], ...{key: val} }
})
if(this.buyWay.isdeliver == -1){
if(res.detail.type == 'physical') {
this.buyWay.isdeliver = res.detail.def_get
}
if(res.detail.type == 'virtual') this.buyWay.isdeliver = 1
}
this.rightData.detail = res.detail
this.rightData.moreAmount = res.amount
this.rightData.total = res.total
this.buyWay.platformCp = arr
this.rightData.freight = res.freight
this.rightData.addressSee = res.address
this.address.allAddress = res.all_address
this.notice.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notice.content = res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 商品数量加减
goodsNumber(e){
let num = this.rightData.num
if (e == 'plus'){
num ++;
}else{
if (num > 1){
num --;
}else{
uni.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
}
this.rightData.num = num
// 获取详情
this.rightsInfo()
},
// 须知展开收起状态
noticeTap() {
this.notice.noticeShow = !this.notice.noticeShow
},
// 收银台跳转
payment() {
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'
});
}
}
});
}
});
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #FFFFFF;
}
/* 权益内容 */
.cont {
width: 100%;
overflow: hidden;
.contBack {
position: relative;
width: 200%;
height: 340rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
.classBack {
position: absolute;
left: 28%;
right: 30%;
width: 44%;
top: 40rpx;
}
}
.classCircle::after,
.contBack::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
.classCircle::after {
left: 20%;
top: -20rpx;
width: 260rpx;
height: 260rpx;
}
.contBack::before {
right: 20%;
top: 55%;
width: 300rpx;
height: 300rpx;
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(28% - 2rpx);
right: calc(30% - 2rpx);
width: calc(44% + 4rpx);
top: 50rpx;
.welfareCont-top{
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 50rpx 0 20rpx;
height: 120rpx;
.welfareCont-list-img {
border-radius: 50%;
width: 120rpx;
height: 120rpx;
display: inline-block;
margin: 0 15rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.rightsCont-btn {
background: rgba(255, 255, 0255, .4);
width: 100%;
line-height: 70rpx;
font-size: 40rpx;
font-weight: 600;
color: #000000;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
// 数量
.rightsNumber {
background-color: #ffffff;
position: relative;
padding: 30rpx 40rpx;
box-sizing: border-box;
.rightsGoods-img {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 80rpx 40rpx 0 270rpx;
box-sizing: border-box;
.rightsGoods-text {
margin-bottom: 40rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
.rightsGoods-number {
flex: 1;
font-size: 34rpx;
text {
font-size: 28rpx;
}
}
.rightsAdd {
display: flex;
.rightsAdd-btn {
border-radius: 4rpx;
text-align: center;
width: 50rpx;
height: 50rpx;
line-height: 45rpx;
font-size: 40rpx;
font-weight: 600;
}
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input {
width: 100rpx;
text-align: center;
font-size: 28rpx;
line-height: 50rpx;
}
}
}
}
}
// 地址
.rightsList,
.notice,
.detailsStore {
background: white;
padding: 10rpx 0;
box-sizing: border-box;
}
.rightsLabel,
.rightsLabel-pay {
display: flex;
padding: 20rpx 40rpx;
color: #6c6c6c;
font-weight: 600;
font-size: 30rpx;
}
.rightsLabel-left {
flex: 1;
color: #747d86;
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
}
}
.rightsLabel-range {
display: flex;
color: #000;
font-weight: 600;
}
.rightsLabel-address {
display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
&::after,
&::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
&::after {
top: 0;
}
&::before {
bottom: 0;
}
.rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-right {
width: calc(100% - 80rpx);
margin-left: 10rpx;
display: flex;
font-size: 28rpx;
.rightsLabel-address-text {
flex: 1;
color: #000000;
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
}
}
}
}
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
margin: 0 0 0 6rpx;
}
// 购买须知
.notice {
background: white;
padding: 20rpx;
box-sizing: border-box;
border-top: 20rpx #eeeeee solid;
.noticeTitle {
display: flex;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
line-height: 46rpx;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 46rpx;
height: 46rpx;
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-top {
margin: 30rpx 0 10rpx;
font-weight: 600;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
.newrightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 160rpx;
z-index: 9;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
text {
font-size: 38rpx;
color: #fe2d55;
}
}
button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
}
// 选择收货地址
.addressBack {
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .4);
z-index: 10;
width: 100%;
height: 100%;
display: none;
&.active {
display: block;
}
}
.addressCont {
position: fixed;
left: 0;
bottom: -1000%;
transition: .2s;
background: #fff;
z-index: 11;
width: 100%;
&.active {
bottom: 0;
}
.addressCont-title {
height: 90rpx;
line-height: 90rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 600;
position: relative;
&::after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-left {
flex: 1;
}
.addressCont-right {
color: #309ded;
}
}
.header-classify {
white-space: nowrap;
box-sizing: border-box;
height: 600rpx;
.addressCont-list {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
overflow: hidden;
position: relative;
&::after {
position: absolute;
content: '';
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-top {
display: flex;
margin-bottom: 10rpx;
.addressCont-name {
font-weight: 600;
}
}
.addressCont-text {
color: #666;
width: calc(100% - 160rpx);
}
.address-tool-icon {
width: 120rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 4rpx;
text-align: center;
color: #fff;
position: absolute;
top: 45rpx;
right: 10rpx;
background: #dfae2e;
transform: scale(.9, .9);
font-size: 24rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,539 @@
<template>
<view>
<!-- 卡券详情 -->
<view class="details">
<view class="detailsTop">
<view class="detailsTop-name">
{{ details.name }}
</view>
<view class="detailsTop-time">
有效期 {{ details.startTime }} - {{ details.endTime }}
</view>
</view>
<view class="detailsCotent">
<view class="source">活动来源 {{ details.activity_name }}</view>
<view class="detailsBar">
<view class="detailsCode-text">劵码</view>
<image :src="barcode" mode="widthFix"></image>
</view>
<view class="detailsCode-text">
{{ details.code }}
</view>
<view class="detailsCode">
<image :src="qrcode"></image>
<view class="detailsCode-text">
<text>请出示以上券码给网点工作人员</text>
</view>
</view>
<!-- 门店定位 -->
<view class="detailsStore">
<view class="detailsStore-top">
<view class="detailsStore-title">
适用门店
</view>
<navigator class="detailsStore-row" hover-class="none" :url="'/pages/store/index?id=' + details.id + '&type=campus'" v-if="longitude != 0 && latitude != 0">
查看所有
<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>
</view>
</view>
<!-- 使用须知 -->
<view class="detailsText">
<view class="detailsText-title">
使用须知
</view>
<view class="detailsText-tips">
<rich-text :nodes="remark"></rich-text>
</view>
</view>
<!-- 内容介绍 -->
<view class="detailsText">
<view class="detailsText-title">
内容介绍
</view>
<view class="detailsText-tips" v-if="content != null">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
<!-- 底部 -->
<view class="detailsBottom">
<image src="/static/img/campus_details_back.png" mode="aspectFill"></image>
<view class="detailsBottom-cont">
<view class="detailsBottom-title">
校园迎新活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>
</template>
<script>
import { qrcode, barcode, couponinfo, merchantCard } from '@/apis/interfaces/campus'
export default {
data() {
return {
id : 0, //优惠券id
longitude : 0, //经度
latitude : 0, //纬度
details : '', //优惠券信息
stores : [], //商家列表
content : '', //内容介绍
remark : '', //使用须知
qrcode : '', //二维码
barcode : '', //条形码
merchantcardinfo:'' //商家券信息
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 优惠券id
this.id = options.id
// 获取二维码
qrcode(options.id).then(res=>{
this.qrcode = res.qrcode
})
// 获取条形码
barcode(options.id).then(res=>{
this.barcode = res.barcode
})
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-校园迎新活动
getApp().globalData.envType = 'campusEnv'
// 获取定位信息
uni.getLocation({
success: res => {
this.latitude   = res.latitude
this.longitude  = res.longitude
},
complete: () => {
// 获取详情信息
this.detailsInfo();
}
})
},
methods: {
// 详情信息
detailsInfo() {
couponinfo({
coupon_id: this.id,
user_lng: this.longitude,
user_lat: this.latitude
}).then(res=>{
let stores = res.stores
stores.map(res=>{
let distance = res.distance
if(res.distance > 1000){
distance = (distance / 1000) + "km"
}else{
distance = distance + "m"
}
res.km = distance
})
this.details = res.info
this.stores = stores
this.remark = res.info.right.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.content = res.info.right.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
//获取商家券信息
if(res.info.card_type=='merchant_card'){
this.getMerchantCardInfo()
}
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 商家券信息
getMerchantCardInfo(){
merchantCard(this.id).then(res=>{
this.merchantcardinfo = res
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 拨打电话
tel(e) {
let tel = e.currentTarget.dataset.tel
uni.showActionSheet({
itemList : ['呼叫商家电话'],
success : res =>{
if(res.tapIndex==0){
uni.makePhoneCall({
phoneNumber: tel
})
}
}
})
},
// 查看门店详情页
detailsTap(e) {
let store_id = e.currentTarget.dataset.id,
user_lng = this.longitude,
user_lat = this.latitude
uni.navigateTo({
url: '/pages/store/details?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat + '&type=campus'
})
}
}
}
</script>
<style>
page {
background-color: #e83241;
padding: 20rpx;
box-sizing: border-box;
}
/* 卡券详情 */
.details {
background: #ffffff;
margin: 20rpx 20rpx 0;
width: calc(100% - 40rpx);
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
position: relative;
border-radius: 0 0 20rpx 20rpx;
border-bottom: 240rpx solid transparent;
}
.details::after,
.details::before {
position: absolute;
background: #e83241;
content: '';
top: -50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.details::after {
left: -50rpx;
}
.details::before {
right: -50rpx;
}
.detailsCotent {
padding: 40rpx;
box-sizing: border-box;
}
.detailsTop {
border-bottom: 2rpx dashed #c8c8c8;
padding: 40rpx 0;
text-align: center;
background-color: #f5f5f5;
}
.detailsTop-name {
font-size: 38rpx;
font-weight: 600;
margin-bottom: 20rpx;
padding: 0 60rpx;
box-sizing: border-box;
}
.detailsTop-time {
color: #7e7e7e;
font-size: 26rpx;
}
.detailsCode {
text-align: center;
padding: 0 0 20rpx;
margin: 40rpx 0 30rpx;
}
.detailsCode image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
.detailsCode-text, .detailsStore-row {
color: #949494;
font-size: 28rpx;
}
.detailsCode-text {
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #000;
}
.detailsCode-text text {
color: #999;
font-weight: normal;
font-size: 26rpx;
}
.detailsStore {
border-top: 2rpx #c8c8c8 solid;
padding-top: 40rpx;
}
.detailsStore-top, .detailsStore-row {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
}
.detailsStore-title {
flex: 1;
font-weight: 600;
}
.detailsStore-row image {
width: 26rpx;
height: 26rpx;
margin: 3rpx 0 0 6rpx;
}
.detailsStore-list {
position: relative;
margin-bottom: 40rpx;
}
.detailsStore-list:last-child {
margin-bottom: 0;
}
.detailsStore-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.detailsStore-cont {
position: absolute;
left: 130rpx;
top: 0;
width: calc(100% - 130rpx);
display: flex;
}
.detailsStore-left {
width: calc(100% - 90rpx);
margin-right: 30rpx;
}
.detailsStore-tel {
width: 60rpx;
height: 60rpx;
margin-top: 25rpx;
}
.detailsStore-place {
font-size: 24rpx;
line-height: 40rpx;
color: #5a5a5a;
display: flex;
}
.detailsStore-place text {
flex: 1;
display: inline-block;
font-size: 28rpx;
margin-right: 20rpx;
}
.detailsStore-name {
margin-bottom: 20rpx;
}
.detailsText {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
border-top: 2rpx solid #ececec;
}
.detailsText-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsText-tips {
font-size: 26rpx;
line-height: 50rpx;
color: #555557;
padding-bottom: 20rpx;
}
.detailsCode-join {
color: #ee8e44;
font-size: 24rpx;
border-radius: 50rpx;
border: 2rpx solid #ee8e44;
padding: 10rpx 20rpx;
display: inline-block;
margin-top: 30rpx;
}
.detailsCode-join.active {
border: 2rpx solid #999;
color: #999;
}
.source{
margin: 30rpx 0;
font-size: 28rpx;
}
.location {
background: white;
width: 100%;
text-align: center;
margin: 60rpx 0 0;
}
.location text {
font-size: 28rpx;
display: block;
line-height: 46rpx;
color: #999;
}
.location-btn[size="mini"] {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 66rpx;
margin-top: 30rpx;
}
.location-img {
width: 150rpx;
height: 120rpx;
margin-bottom: 20rpx;
}
.detailsBar {
text-align: center;
padding: 0 50rpx;
box-sizing: border-box;
margin-top: 60rpx;
margin-bottom: 40rpx;
}
.detailsBar image {
width: 100%;
}
.detailsBar .detailsCode-text {
margin-bottom: 10px;
color: #000;
}
.detailsBottom {
position: fixed;
width: 100%;
height: 220rpx;
left: 0;
bottom: 0;
z-index: 9;
}
.detailsBottom image {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.detailsBottom-cont {
z-index: 10;
position: absolute;
left: 0;
top: 70rpx;
width: 100%;
text-align: center;
color: #9a9a9a;
font-size: 26rpx;
}
.detailsBottom-title {
font-weight: 600;
margin-bottom: 20rpx;
font-size: 30rpx;
}
</style>

View File

@@ -0,0 +1,323 @@
<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>
<!-- 电影券 -->
<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="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>
</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>
</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>
</view>
<!-- 按钮 -->
<view @click="userNav('/pages/campus/myCoupon')" class="campusBtn">我的优惠券<text>立即查看</text></view>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/campus'
export default {
data() {
return {
topData : [], // 头部推荐
filmData : [], // 电影活动列表
marketData : [], // 超市活动列表
bathData : [], // 洗浴活动列表
repastData : [], // 餐饮活动列表
}
},
// 生命周期函数--监听页面加载
onLoad(options) {},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-校园迎新活动
getApp().globalData.envType = 'campusEnv'
// 获取首页数据
this.indexInfo();
},
methods: {
// 首页数据
indexInfo() {
index().then(res=>{
this.topData = res.top
this.filmData = res.film
this.marketData = res.market
this.bathData = res.bath
this.repastData = res.repast
}).catch(err=>{
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url
if(uni.getStorageSync("token")) {
uni.navigateTo({
url: pageUrl
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/campus/signin'
})
},
}
}
</script>
<style lang="scss" scoped>
page {
background: linear-gradient(to bottom, #fdf5cc, #cbaf7f);
padding-bottom: 100rpx;
}
// banner
.campusBanner {
width: 100%;
}
// 推荐
.recommend {
overflow: hidden;
margin-top: -60rpx;
padding: 0 30rpx;
box-sizing: border-box;
.recommend-label {
text-align: center;
width: calc(50% - 20rpx);
float: left;
margin: 0 10rpx 30rpx;
.recommend-label-img {
width: 150rpx;
height: 150rpx;
margin: 0 auto 10rpx;
background: linear-gradient(to bottom, #293350, #484e74);
box-shadow: 0px 8px 6px rgba(249,228,129,.5);
border-radius: 50%;
box-sizing: border-box;
image {
width: 80rpx;
height: 80rpx;
margin: 35rpx;
}
}
.recommend-label-text {
font-weight: 600;
text {
display: block;
font-size: 30rpx;
}
}
}
}
// 列表
.film {
width: 100%;
padding: 10rpx 30rpx;
box-sizing: border-box;
}
.filmTitle {
background: linear-gradient(to right, #feefce, #fbe9c0, #e8d19b);
line-height: 80rpx;
box-shadow: -4px 0 10px rgba(134,97,33,.2);
text-align: center;
border-radius: 10rpx 10rpx 0 0;
color: #a47d53;
font-weight: 600;
margin: 0 20rpx;
}
.filmList {
background: linear-gradient(to right, #494e75, #27314d);
box-shadow: 0px 6px 10px rgba(134,97,33,.5);
border-radius: 10rpx;
padding: 50rpx 30rpx 30rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
.filmList-top {
display: flex;
margin-bottom: 10rpx;
.filmList-top-name {
width: calc(100% - 160rpx);
margin-right: 20rpx;
color: #fce2ae;
font-size: 34rpx;
font-weight: bold;
text {
display: block;
font-size: 25rpx;
margin-top: 10rpx;
font-weight: normal;
}
}
.filmList-top-price {
position: relative;
background: linear-gradient(to right, #d3ad68, #cda65f);
box-shadow: 0px 2px 10px rgba(249,228,129,.5);
width: 120rpx;
height: 120rpx;
border-radius: 50%;
color: #FFFFFF;
text-align: center;
padding-top: 20rpx;
font-size: 30rpx;
box-sizing: border-box;
text {
display: block;
text-shadow: 0px 6px 10px rgba(134,97,33,.5);
}
.filmList-tag{
position: absolute;
background: #ff0000;
color: white;
font-size: 20rpx;
top: -10%;
left: 20%;
width: 120rpx;
padding: 0 10rpx;
line-height: 40rpx;
border-radius: 15rpx;
transform: scale(0.58)
}
}
}
.filmList-text {
font-size: 20rpx;
color: #c1c1c1;
// margin-left: -70rpx;
text {
display: block;
// transform: scale(0.8)
}
}
}
// 按钮
.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;
padding-left: 20rpx;
}

View File

@@ -0,0 +1,653 @@
<template>
<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>, 欢迎参加校园迎新活动
</view>
<!-- 我的卡券 -->
<view class="borderContent">
<view class="campusCont">
<!-- 卡券tab -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : stateType == item.used}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-index="(index)" :data-state="(item.used)">
{{ item.title }}
<view v-if="item.used == 0">({{count.init}})</view>
<view v-else-if="item.used == 1">({{count.used}})</view>
<view v-else>({{ count.pass }})</view>
</view>
</view>
<!-- 卡券列表 -->
<view class="coupon" v-if="coupons.length > 0" :class="{active : coupons.length < 1}">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item, index) in coupons" :key="index">
<view hover-class="none" class="couponList" @tap="couponUrl" :data-id="(item.coupon_id)">
<view class="couponList-left">
<image class="couponList-img" src="/static/img/coupon_coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="/static/img/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="/static/img/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{item.activity_name}}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{item.used_at}}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
</view>
<view class="couponMore" v-if="item.count > 1" >
<view class="couponMore-text" @tap="couponTap" :data-id="(item.activityId)" :data-status="(item.status)">
<view class="couponMore-title">查看全部{{ item.count }}张卡券</view>
<image class="couponMore-arrow" src="/static/icon/arrow_left.png"></image>
</view>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="campus_tips" v-else>
<image src="/static/img/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</view>
<!-- 底部快捷导航 -->
<view class="navFooter">
<navigator hover-class="none" url="/pages/campus/index" class="navFooter-label">
<image src="/static/icon/navFooter_icon_00.png" mode=""></image>
活动中心
</navigator>
<view class="navFooter-label active">
<image src="/static/icon/navFooter_icon_01_active.png" mode=""></image>
我的优惠券
</view>
</view>
<!-- 漂浮窗 -->
<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 class="followBack" :class="{active : followState}"></view>
<view class="followPop" :class="{active : followState}">
<image class="followPop-img" src="/static/img/subscribe.png" mode="widthFix"></image>
<view class="followPop-text">
<text>长按识别图中二维码</text>
<image src="/static/img/follow_tips.png" mode="aspectFill"></image>
</view>
<view class="followPop-tips">
本时生活平台优惠活动
</view>
</view>
<image class="followPop-clos" :class="{active : followState}" src="/static/icon/add.png" mode="aspectFill" @click="followBtn"></image>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/user'
import { coupon } from '@/apis/interfaces/campus'
export default {
data() {
return {
userTel : '', //用户者手机号
coupons : [], //优惠券列表
count : '', //优惠券-张数
//优惠券Tab列表
couponLabel : [
{ title : "未使用", used: 0 },
{ title : "已使用", used: 1 },
{ title : "已过期", used: 2 }
],
stateType : '0', //卡券状态
type : '', //卡券来源
followState : false //二维码弹出状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 获取用户信息
index().then(res => {
this.userTel = res.info.username
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
});
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-校园迎新活动
getApp().globalData.envType = 'campusEnv'
// 获取列表
this.couponInfo();
},
methods: {
// 卡券列表
couponInfo() {
coupon({
status: this.stateType,
type: 'school'
}).then(res=>{
this.count = res.count
this.coupons = res.list
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// tabs 选项卡
orderTab(e){
if(this.stateType != e.currentTarget.dataset.state){
this.stateType = e.currentTarget.dataset.state
// 获取卡权益
this.couponInfo()
}
},
// 查看优惠券分组
couponTap(e) {
let id = e.currentTarget.dataset.id,
status = e.currentTarget.dataset.status
uni.navigateTo({
url: '/pages/campus/myList?id=' + id + '&status=' + status
})
},
// 优惠券跳转详情
couponUrl(e) {
let newId = e.currentTarget.dataset.id
uni.navigateTo({
url: '/pages/campus/details?id=' + newId
})
},
// 公众号展示
followBtn() {
this.followState = !this.followState
}
}
}
</script>
<style>
.campusCoupon {
width: 100vw;
}
page {
background-color: #c32631;
}
/* 用户信息 */
.user {
width: 100%;
background: linear-gradient(to right, #f9ecb7, #eed276);
font-size: 28rpx;
padding: 20rpx;
box-sizing: border-box;
color: #da2025;
display: flex;
line-height: 48rpx;
}
.user text {
font-weight: 600;
padding: 0 10rpx;
}
.user image {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
/* 优惠券 */
.borderContent {
border-bottom: 140rpx solid transparent;
}
.campusCont {
background-color: #e83241;
margin: 30rpx 20rpx;
border-radius: 20rpx;
padding: 20rpx;
box-sizing: border-box;
}
.campusCont.active {
border-bottom: 140rpx solid transparent;
}
.couponTab{
background-color: #d32838;
color: #ffffff;
display: flex;
padding: 20rpx 40rpx 0;
box-sizing: border-box;
border-radius: 20rpx 20rpx 0 0;
}
.couponTab-label {
flex: 3;
text-align: center;
position: relative;
padding: 10rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
border-radius: 20rpx 20rpx 0 0;
}
.couponTab-label.active {
background-color: #fdf4ed;
color: #b9505f;
}
.couponTab-label view {
font-size: 24rpx;
margin-top: 6rpx;
}
.coupon {
padding-bottom: 10rpx;
box-sizing: border-box;
}
.couponCont {
margin: 0 0 30rpx;
width: 100%;
border-radius: 10rpx;
overflow: hidden;
}
.couponCont:last-child {
margin-bottom: 0;
}
.couponList {
background: #fdf4ed;
width: 100%;
height: 160rpx;
position: relative;
}
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
}
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius: 50%;
padding: 20rpx;
box-sizing: border-box;
}
.couponList-icon image {
width: 100%;
height: 100%;
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 35rpx;
width: calc(100% - 330rpx);
}
.couponList-center.active {
top: 15rpx;
}
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
color: #743e3e;
}
.couponList-time,
.couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-bottom: 14rpx;
color: #855757;
}
.couponList-right {
background: transparent;
border: 2rpx solid #fc9f36;
color: #f39124;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
}
.couponList-right.active {
background: #dddddd;
}
.couponMore {
font-size: 28rpx;
color: #686868;
position: relative;
height: 120rpx;
}
.couponMore::after,
.couponMore::before {
position: absolute;
content: '';
height: 20rpx;
border-radius: 10rpx;
background: #fff;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
z-index: 1;
height: 30rpx;
}
.couponMore::after {
width: calc(100% - 40rpx);
top: 70rpx;
left: 20rpx;
}
.couponMore::before {
width: calc(100% - 80rpx);
top: 90rpx;
left: 40rpx;
}
.couponMore-text {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 99;
height: 80rpx;
border-radius: 0 0 10rpx 10rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
}
.couponMore-title {
flex: 1;
}
.couponMore-arrow {
width: 28rpx;
height: 28rpx;
margin-top: 26rpx;
}
.couponCont.active .couponList-img,
.couponCont.active .couponList-icon {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.coupoTips {
position: absolute;
top: 22rpx;
right: 20rpx;
z-index: 99;
width: 120rpx;
height: 120rpx;
}
.campus_tips {
text-align: center;
width: 100%;
background-color: #ffffff;
border-radius: 0 0 20rpx 20rpx;
padding: 80rpx 0;
font-size: 28rpx;
}
.campus_tips image {
width: 160rpx;
height: 160rpx;
margin-bottom: 20rpx;
}
/* 底部快捷导航 */
.navFooter {
position: fixed;
width: 100%;
height: 110rpx;
background-color: #FFFFFF;
z-index: 1000;
left: 0;
bottom: 0;
font-size: 26rpx;
display: flex;
}
.navFooter-label {
flex: 2;
text-align: center;
width: 50%;
color: #a2a2a2;
}
.navFooter-label.active {
color: #c32631;
}
.navFooter-label image {
width: 54rpx;
height: 54rpx;
display: block;
margin: 8rpx auto 0;
}
/* 漂浮弹出层 */
.indexFloat {
position: fixed;
right: 20rpx;
bottom: 180rpx;
z-index: 99;
}
.indexFloat-text {
height: 40rpx;
overflow: hidden;
color: #000000;
}
.indexFloat-text text {
line-height: 40rpx;
display: block;
font-size: 24rpx;
}
.indexFloat-animation {
width: 130rpx;
height: 130rpx;
animation: shake 3s linear infinite;
}
@keyframes shake {
70%, 80% {
transform: rotate(7deg);
}
75% {
transform: rotate(-7deg);
}
65%,
85% {
transform: rotate(0);
}
}
/* 关注公众号弹出 */
.followBack {
position: fixed;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,.7);
left: 0;
top: 0;
z-index: 1000;
display: none;
}
.followBack.active {
display: block;
}
.followPop {
position: fixed;
z-index: 1001;
height: 760rpx;
left: 15%;
right: 15%;
top: 300rpx;
background-color: #ffffff;
border-radius: 20rpx;
text-align: center;
overflow: hidden;
display: none;
}
.followPop.active {
display: block;
}
.followPop-img {
width: 70%;
margin: 60rpx 0 50rpx;
}
.followPop-text {
color: #7d7d7d;
font-size: 32rpx;
position: relative;
}
.followPop-text::after,
.followPop-text::before {
position: absolute;
content: '';
top: 25rpx;
width: 60rpx;
height: 2rpx;
background-color: #cfcfcf;
}
.followPop-text::after {
left: 30rpx;
}
.followPop-text::before {
right: 30rpx;
}
.followPop-text image {
width: 120rpx;
height: 120rpx;
margin: 10rpx auto 20rpx;
display: block;
}
.followPop-tips {
background-color: #e1e5ec;
line-height: 90rpx;
color: #7f8487;
}
.followPop-clos {
position: fixed;
top: 1100rpx;
left: calc(50% - 25rpx);
width: 50rpx;
height: 50rpx;
z-index: 1001;
display: none;
transform: rotate(45deg);
}
.followPop-clos.active {
display: block;
}
</style>

View File

@@ -0,0 +1,315 @@
<template>
<view>
<!-- 我的卡券列表 -->
<view class="coupon" v-if="couponArr.length > 0">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item, index) in couponArr" :key="index">
<view hover-class="none" class="couponList" @tap="couponUrl" :data-id="(item.id)">
<view class="couponList-left">
<image class="couponList-img" src="/static/img/coupon_coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="/static/img/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="/static/img/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{item.activity_name}}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{item.used_at}}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { couponArr } from '@/apis/interfaces/user'
export default {
data() {
return {
couponArr : '', //卡券组列表
id : '', //优惠券携带id
status : '', //优惠券携带状态
page : 1, //分页
lodingStats : false //加载状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.id = options.id
this.status = options.status
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-校园迎新活动
getApp().globalData.envType = 'campusEnv'
// 获取卡券组列表
this.couponInfo();
},
methods: {
// 卡券列表
couponInfo(page) {
couponArr({
activityId: this.id,
status: this.status,
page: page || ''
}).then(res=>{
let listArr = this.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.couponArr = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 优惠券跳转
couponUrl(e) {
let newId = e.currentTarget.dataset.id
uni.navigateTo({
url: '/pages/campus/details?id=' + newId
})
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取团购列表
this.couponInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.couponInfo(pageNumber)
}
}
}
}
</script>
<style>
page {
background-color: #e83241;
}
.coupon {
margin-top: 30rpx;
}
.couponCont {
margin: 20rpx;
width: calc(100% - 40rpx);
border-radius: 10rpx;
overflow: hidden;
}
.couponList {
background: #fdf4ed;
width: 100%;
height: 160rpx;
position: relative;
}
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
}
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius: 50%;
padding: 20rpx;
box-sizing: border-box;
}
.couponList-icon image {
width: 100%;
height: 100%;
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 35rpx;
width: calc(100% - 330rpx);
}
.couponList-center.active {
top: 15rpx;
}
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
color: #743e3e;
}
.couponList-time,
.couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-bottom: 14rpx;
color: #855757;
}
.couponList-right {
background: transparent;
border: 2rpx solid #fc9f36;
color: #f39124;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
}
.couponList-right.active {
background: #dddddd;
}
.couponMore {
font-size: 28rpx;
color: #686868;
position: relative;
height: 120rpx;
}
.couponMore::after,
.couponMore::before {
position: absolute;
content: '';
height: 20rpx;
border-radius: 10rpx;
background: #fff;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
z-index: 1;
height: 30rpx;
}
.couponMore::after {
width: calc(100% - 40rpx);
top: 70rpx;
left: 20rpx;
}
.couponMore::before {
width: calc(100% - 80rpx);
top: 90rpx;
left: 40rpx;
}
.couponMore-text {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 99;
height: 80rpx;
border-radius: 0 0 10rpx 10rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
}
.couponMore-title {
flex: 1;
}
.couponMore-arrow {
width: 28rpx;
height: 28rpx;
margin-top: 26rpx;
}
.couponCont.active .couponList-img,
.couponCont.active .couponList-icon {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.coupoTips {
position: absolute;
top: 22rpx;
right: 20rpx;
z-index: 99;
width: 120rpx;
height: 120rpx;
}
</style>

View File

@@ -0,0 +1,231 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<button class="campus-form-btn" form-type="submit">设置新密码</button>
</form>
</view>
</view>
</template>
<script>
import { send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]||16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || ''
auth({
mobile: mobileNo,
code: code,
type: 'reset_password'
}).then(res => {
this.$store.commit('setToken', res.token)
uni.redirectTo({
url: '/pages/campus/setPassword'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,238 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="submitRegister">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue"
name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请输入密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请确认密码" name="password_confirmation"></input>
</view>
<button class="campus-form-btn" form-type="submit">注册</button>
</form>
</view>
</view>
</template>
<script>
import { send, register } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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({
title : err.message,
icon :'none',
duration: 2000
})
})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
submitRegister(e){
let formValue = e.detail.value
register({
mobile : formValue.mobile,
password : formValue.password,
password_confirmation : formValue.password_confirmation,
code : this.code,
parent_id : 0
}).then(res => {
this.$store.commit('setToken', res.token)
uni.showModal({
title : "提示",
content : "注册成功",
showCancel : false,
confirmText : "确定",
success : modalRes => {
if(modalRes.confirm){
uni.reLaunch({
url: '/pages/campus/index'
})
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,169 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="设置新的登录密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="确认新的登录密码" name="newpassword"></input>
</view>
<button class="campus-form-btn" form-type="submit">找回</button>
</form>
</view>
</view>
</template>
<script>
import { passSetup } from '@/apis/interfaces/auth'
export default {
data() {
return {
}
},
methods: {
// 立即登录
forgetlogin(e){
let newPass = e.detail.value.newpassword || '',
password = e.detail.value.password || ''
passSetup({
password: password,
password_confirmation: newPass
}).then(res => {
uni.showToast({
title: "密码重置成功",
icon : 'none'
})
uni.reLaunch({
url: '/pages/campus/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,259 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/campus_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code" v-if="!passwordLogin">
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs" v-else>
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="password" placeholder="请输入登录密码" name="password"></input>
</view>
<view class="resPassword">
<navigator url="./password">忘记密码</navigator>
</view>
<button class="campus-form-btn" form-type="submit">登录</button>
</form>
<view class="login-box">
<view @click="onCutLogin">{{passwordLogin ? '验证码登录': '密码登录'}}</view>
<navigator url="./register">快速注册</navigator>
</view>
</view>
</view>
</template>
<script>
import { send, auth, passlogin } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
passwordLogin: false, // 登录方式
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]|16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || '',
password = e.detail.value.password || '',
loginFunction
if(this.passwordLogin){
loginFunction = passlogin({
mobile : mobileNo,
password: password
})
}else{
loginFunction = auth({
mobile: mobileNo,
code: code,
type: ''
})
}
loginFunction.then(res => {
this.$store.commit('setToken', res.token)
uni.reLaunch({
url: '/pages/campus/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 90rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
navigator{
display: inline-block;
}
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,522 @@
<template>
<view>
<!-- 卡券 -->
<view class="contentBorder">
<view class="contentTop">
<view class="contentCard">
<view class="contentCard-mark">校园活动</view>
<view class="contentCard-top">
<image class="contentCard-top-img" src="/static/img/tel_img.png" mode="aspectFill"></image>
<view class="contentCard-top-title">
<view class="contentCard-top-text">
{{ detail.title }}
</view>
<view class="contentCard-top-copy">
{{ detail.type_no }}
<text>复制</text>
</view>
</view>
</view>
<view class="contentCard-bottom">
<view class="contentCard-bottom-explain" @click="noticeClick">
<image src="/static/icon/contentCard_icon.png" mode="aspectFill"></image>购买须知
</view>
<view class="contentCard-bottom-tips">
<view class="contentCard-bottom-title">限时活动</view>
<view class="contentCard-bottom-price">
<view class="contentCard-bottom-present">
<text></text>{{ detail.price }}
</view>
<view class="contentCard-bottom-cost">
{{ detail.price }}
</view>
</view>
</view>
</view>
</view>
</view>
<view class="contentTop">
<view class="contentLabel">
<label>购买数量</label>
<view class="rightsAdd">
<view class="rightsAdd-btn" @tap="goodsNumber('remove')">-</view>
<input class="rightsAdd-input" :value="num" type="number" disabled=""></input>
<view class="rightsAdd-btn" @tap="goodsNumber('plus')">+</view>
</view>
</view>
<view class="contentLabel">
<label>支付方式</label>
<view class="contentLabel-right">
<view class="contentLabel-right-name">
在线支付
</view>
<view class="contentLabel-right-pay">
<text>沃支付</text>
<text>微信支付</text>
</view>
</view>
</view>
<view class="contentLabel">
<label v-if="detail.attribute">{{ detail.attribute.form_price }}</label>
<view class="contentLabel-right">
<view class="contentLabel-right-name">
{{ detail.price }}
</view>
</view>
</view>
<view class="contentLabel">
<label v-if="detail.attribute">{{ detail.attribute.form_pay }}</label>
<view class="contentLabel-right">
<view class="contentLabel-right-name">
{{ amount }}
</view>
</view>
</view>
</view>
<view class="contentTop contentMargin">
<view class="contentTop-introduce">
<view class="contentTop-introduce-title">
内容介绍
</view>
<view class="contentTop-introduce-text">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
</view>
<!-- 按钮 -->
<view class="rightsBtn" @tap="payment">
<button class="rightsBtn-btn" :disabled="disabled">立即购买</button>
</view>
<!-- 购买须知 -->
<view class="popNoticeBack" :class="{active : noticeState}"></view>
<view class="popNotice" :class="{active : noticeState}">
<view class="popNotice-text">购买须知</view>
<view class="popNotice-cont">
<rich-text :nodes="remark"></rich-text>
</view>
<view class="popNotice-btn" @click="noticeClick">
我知道了
</view>
</view>
</view>
</template>
<script>
import { buy, buySubmit } from '@/apis/interfaces/campus'
export default {
data() {
return {
groupId : '', //权益id
detail : '', //权益详情
amount : '', //总金额
num : 1, //购买的数量
content : '', //内容介绍
notification: '', //重要提示
remark : '', //使用须知
disabled : false, //购买按钮状态
noticeState : false //使用须知弹出层
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.groupId = options.id
this.code = options.code || ''
},
// 生命周期函数--监听页面显示
onShow() {
// 获取详情
this.rightsInfo();
},
methods: {
// 详情
rightsInfo() {
buy({activity_school_id: this.groupId, qty: this.num}).then(res => {
this.num = res.qty
this.detail = res.detail
this.amount = res.amount
this.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.content= res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
})
},
// 商品数量加减
goodsNumber(val){
let num = this.num
if (val == 'plus'){
num ++;
}else{
if (num > 1){
num --;
}else{
uni.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
}
this.num = num
// 获取详情
this.rightsInfo()
},
// 购买须知弹框
noticeClick() {
this.noticeState = !this.noticeState
},
// 收银台跳转
payment() {
buySubmit({activity_school_id: this.groupId, qty: this.num, is_deliver: 1}).then(res => {
uni.navigateTo({
url: '/pages/cashier/index?tradeNo=' + res.trade_no + '&type=school' + '&price=' + this.amount
})
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/campus/signin'
});
}
}
});
}
});
}
}
}
</script>
<style>
.contentTop {
width: 100vw;
background: #FFFFFF;
margin-bottom: 30rpx;
border-bottom: 2rpx solid #efefef;
border-top: 2rpx solid #efefef;
}
.contentCard {
margin: 40rpx;
width: calc(100% - 80rpx);
background-color: #bc1d30;
border-radius: 20rpx;
overflow: hidden;
color: #ffffff;
position: relative;
}
.contentCard-mark {
position: absolute;
opacity: .9;
background-color: #920011;
font-size: 28rpx;
padding: 10rpx 20rpx;
right: 30rpx;
top: 0;
}
.contentCard-top {
text-align: center;
padding: 60rpx 0;
box-sizing: border-box;
}
.contentCard-top-img {
width: 110rpx;
height: 110rpx;
border-radius: 50%;
margin-bottom: 20rpx;
border: 4rpx solid #fb7d7d;
display: inline-block;
}
.contentCard-top-title {
font-size: 28rpx;
}
.contentCard-top-text {
font-size: 32rpx;
margin-bottom: 20rpx;
}
.contentCard-top-copy {
color: #ffc8cf;
}
.contentCard-top-copy text {
border: 2rpx solid #ffc8cf;
font-size: 24rpx;
border-radius: 30rpx;
padding: 0 10rpx;
height: 32rpx;
line-height: 32rpx;
display: inline-block;
margin-left: 15rpx;
transform : scale(.85)
}
.contentCard-bottom {
background-color: rgba(0,0,0,.15);
height: 80rpx;
line-height: 80rpx;
display: flex;
padding: 0 20rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.contentCard-bottom-explain {
display: flex;
flex: 1;
opacity: .8;
}
.contentCard-bottom-explain image {
width: 42rpx;
height: 42rpx;
margin: 18rpx 10rpx 0 0;
}
.contentCard-bottom-tips,
.contentCard-bottom-price {
display: flex;
}
.contentCard-bottom-title {
background-color: #e69500;
height: 50rpx;
line-height: 50rpx;
padding: 0 15rpx;
border-radius: 10rpx;
margin-top: 16rpx;
transform : scale(.85)
}
.contentCard-bottom-title::after {
position: absolute;
content: '';
width: 0;
height: 0;
border-top: 25rpx solid transparent;
border-left: 25rpx solid #e69500;
border-bottom: 25rpx solid transparent;
}
.contentCard-bottom-present {
margin: 0 10rpx;
font-size: 40rpx;
}
.contentCard-bottom-present text,
.contentCard-bottom-cost {
font-size: 24rpx;
}
.contentCard-bottom-cost {
text-decoration: line-through;
padding-top: 4rpx;
}
.contentLabel {
display: flex;
padding: 30rpx 40rpx;
box-sizing: border-box;
border-bottom: #efefef 2rpx solid;
font-size: 30rpx;
}
.contentLabel:last-child {
margin-bottom: 0;
border: none;
}
.contentLabel label {
flex: 1;
line-height: 54rpx;
}
.contentLabel-right-name {
text-align: right;
margin-bottom: 10rpx;
}
.contentLabel-right-pay text {
font-size: 26rpx;
padding: 2rpx 10rpx;
border-radius: 10rpx;
color: #e56012;
border: 1rpx solid #e56012;
margin-left: 15rpx;
}
.contentLabel-right-pay text:last-child {
color: #29c529;
border-color: #29c529;
}
.rightsAdd {
display: flex;
border: 2rpx solid #efefef;
}
.rightsAdd-btn {
width: 54rpx;
height: 54rpx;
line-height: 54rpx;
text-align: center;
border-radius: 4rpx;
font-size: 38rpx;
color: #666666;
}
.rightsAdd-input {
width: 80rpx;
height: 54rpx;
font-size: 30rpx;
text-align: center;
border-left: 2rpx solid #efefef;
border-right: 2rpx solid #efefef;
}
.contentBorder {
border-bottom: 140rpx solid transparent;
}
.contentTop-introduce-title {
text-align: center;
line-height: 100rpx;
font-size: 34rpx;
position: relative;
}
.contentTop-introduce-title::after,
.contentTop-introduce-title::before{
position: absolute;
width: 100rpx;
height: 2rpx;
top: 50rpx;
content: '';
background-color: #dadada;
}
.contentTop-introduce-title::after {
left: 20%;
}
.contentTop-introduce-title::before {
right: 20%;
}
.contentTop-introduce-text {
padding: 0 40rpx 40rpx;
color: #a0a0a2;
box-sizing: border-box;
font-size: 30rpx;
}
/* 按钮 */
.rightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #FFFFFF;
z-index: 1002;
height: 140rpx;
padding: 30rpx;
box-sizing: border-box;
}
.rightsBtn-btn {
background-color: #bc1d30;
color: #ffffff;
height: 90rpx;
line-height: 90rpx;
width: 100%;
font-size: 32rpx;
padding: 0;
margin: 0;
}
.popNoticeBack {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
background: rgba(0,0,0,.7);
z-index: 1003;
display: none;
}
.popNoticeBack.active {
display: block;
}
.popNotice {
position: fixed;
left: 15%;
right: 15%;
top: 30%;
background-color: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
z-index: 1004;
display: none;
}
.popNotice.active {
display: block;
}
.popNotice-text {
text-align: center;
font-weight: 600;
line-height: 90rpx;
}
.popNotice-cont {
border-top: 2rpx solid #efefef;
border-bottom: 2rpx solid #efefef;
padding: 50rpx 30rpx;
box-sizing: border-box;
font-size: 30rpx;
}
.popNotice-btn {
color: #FFFFFF;
line-height: 90rpx;
font-size: 30rpx;
text-align: center;
background-color: #e69500;
}
</style>

View File

@@ -0,0 +1,909 @@
<template>
<view>
<!-- 立即购买 -->
<view class="newrightsBtn" @tap="submitOrder">
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">{{ dataInfo.num }}件商品 </view>
<view>实付<text>{{ dataInfo.amount }}</text></view>
</view>
<button :disabled="disabled">立即购买</button>
</view>
<view style="padding-bottom: 100px">
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://lifetest.ysd-bs.com/storage/materials/2021/08/09/class_back_02.png"
mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont" v-if="dataInfo.detail">
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" v-for="(item, index) in dataInfo.detail.logos" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
</scroll-view>
<view class="nowrap rightsCont-btn">
{{ dataInfo.detail.title }}
</view>
</view>
</view>
</view>
<view class="rightsNumber">
<image class="rightsGoods-img" :src="dataInfo.detail.goods_cover" mode="aspectFill"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{ dataInfo.detail.title }}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number"><text></text>{{ dataInfo.detail.price }}</view>
<view class="rightsAdd">
<!-- @tap="goodsNumber(remove)" -->
<view class="rightsAdd-btn rightsAdd-remove" :class="{active : num != 1}">-</view>
<input class="rightsAdd-input" :value="dataInfo.num" type="number" disabled></input>
<view class="rightsAdd-btn rightsAdd-plus">+</view>
<!-- @tap="goodsNumber(plus)" -->
</view>
</view>
</view>
</view>
<view class="rightsList" style="padding: 0 0 2rpx" v-if="dataInfo.detail.attribute">
<view class="rightsLabel">
<view class="rightsLabel-left">{{ dataInfo.detail.attribute.form_type }}</view>
<view class="rightsLabel-right rightsLabel-red">-{{ dataInfo.score }}</view>
</view>
<view class="rightsLabel">
<view class="rightsLabel-left">{{dataInfo.detail.attribute.form_pay}}</view>
<view class="rightsLabel-right">{{ dataInfo.amount }}</view>
</view>
</view>
<!-- 规格 -->
<view class="rightsList" v-if="dataInfo.detail.type == 'physical'">
<view class="rightsLabel">
<view class="rightsLabel-left">提交方式</view>
<view class="rightsLabel-right rightsLabel-range">
<picker :range="plat.platformCp" :range-key="'name'" @change="platBind">
<view class="tabs-text">
{{ plat.platformCp[plat.platIndex].name }}
</view>
</picker>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</view>
<view class="rightsLabel rightsLabel-address" v-if="plat.platformCp[plat.platIndex].name == '快递'">
<image class="rightsLabel-icon" src="https://card.ysd-bs.com/storage/materials/2021/09/01/new_rightsAddress.png"></image>
<block v-if="dataInfo.detail.address != ''">
<view class="rightsLabel-right" @tap="addressTap">
<view class="rightsLabel-address-text">
<view class="rightsLabel-address-name">{{ dataInfo.detail.address.name }}<view class="rightsLabel-address-tel">{{ dataInfo.detail.mobile }}</view></view>
<text class="nowrap">{{ dataInfo.detail.address.all_address }}</text>
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</block>
<block v-else>
<navigator class="rightsLabel-right" hover-class="none" url="/pages/address_form/address_form?type=Add">
<view class="rightsLabel-address-text" style="line-height: 90rpx;">
添加收货地址
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</navigator>
</block>
</view>
<view class="rightsLabel" v-if="plat.platformCp[plat.platIndex].name == '快递'">
<view class="rightsLabel-left">快递运费</view>
<view class="rightsLabel-right rightsLabel-freight">{{ dataInfo.freight }}</view>
</view>
</view>
<!-- 支付方式 -->
<!-- <view class="rightsList" style="padding: 0 0 2rpx">
<view class="radioList" style="padding: 30rpx">
<radio-group @change="payBind">
<view class="payContList-label">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wx.jpg"></image>
微信支付
</view>
<radio class="radio" value="0" checked></radio>
</view>
<view class="payContList-label">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wqb.jpg"></image>
沃钱包支付
</view>
<radio class="radio" value="1"></radio>
</view>
</radio-group>
</view>
</view> -->
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @tap="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读使用须知内容介绍
</view>
<image class="noticeTitle-row" :class="{active : dataInfo.noticeShow}" src="/static/icon/rightsArrow.png"></image>
</view>
<view class="noticeText" :class="{active : dataInfo.noticeShow}">
<view class="noticeText-top">购买须知</view>
<view class="noticeText-cont">
<rich-text :nodes="dataInfo.remark"></rich-text>
</view>
<view class="noticeText-top">内容介绍</view>
<view class="noticeText-cont">
<rich-text :nodes="dataInfo.content"></rich-text>
</view>
</view>
</view>
</view>
<!-- 选择收货地址 -->
<view class="addressBack" :class="{ active : address.addressShow }" @tap="addressHide"></view>
<view class="addressCont" :class="{ active : address.addressShow }">
<view class="addressCont-title uni-border-bottom">
<view class="addressCont-left">请选择收货地址</view>
<view class="addressCont-right" @tap="addSelect">新增收货地址</view>
</view>
<scroll-view class="header-classify" scroll-y="true">
<view class="addressCont-list uni-border-bottom" v-for="(item, index) in address.allAddress" :key="index"
@tap="selectAddress(item.id, item)">
<view class="addressCont-top">
<view class="addressCont-name">{{ item.name }}</view>
<view class="addressCont-tel">{{ item.mobile }}</view>
</view>
<view class="addressCont-text">
{{ item.all_address }}
</view>
<view class="address-tool-icon">选择地址</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import { washcarBuy, washcarCreate } from '@/apis/interfaces/rights'
export default {
data() {
return {
dataInfo : {
rightId : '', // 权益id
detail : '', // 权益详情
welfareId : '', // 活动id
amount : '', // 总金额
moreAmount : '', // 产品金额
num : 1, // 购买的数量
score : '', // 应付总积分
freight : '', // 运费
welfareType : '', // 权益类型
content : '', // 内容介绍
remark : '', // 使用须知
noticeShow : false, // 须知显示状态
},
address : {
addefault : '', // 默认地址
allAddress : [], // 收货地址列表
addressShow : false // 收货地址显示
},
plat : {
platIndex : 0, // 选择提交方式下标
isdeliver : -1, // 快递还是自提参数
platformCp : [] // 选择提交数组
},
pay : {
payWayIndex : 0,
payWay : [
{value: 0, name: "微信支付"},
{value: 1, name: "沃钱包支付"}
]
},
disabled : false // 下单按钮状态
}
},
onLoad(options) {
this.dataInfo.rightId = options.right_id,
this.dataInfo.welfareId = options.welfare_id
// 获取卡券列表
this.couponInfo()
},
methods:{
// 卡券列表
couponInfo() {
washcarBuy({
welfare_id : this.dataInfo.welfareId,
right_id : this.dataInfo.rightId,
qty : this.dataInfo.num,
address_id : this.address.addefault.id,
is_deliver : this.plat.isdeliver
}).then(res=>{
let obj = res.detail.express
let defGet = res.detail.def_get
let arr = new Array
arr = Object.keys(obj).map(val=>{
return { ...obj[val], ...{key: val} }
})
if(this.plat.isdeliver == -1){
if(res.detail.type == 'physical') this.plat.isdeliver = res.detail.def_get
if(res.detail.type == 'virtual') this.plat.isdeliver = 1
}
this.dataInfo.detail = res.detail
this.dataInfo.num = res.qty
this.dataInfo.freight = res.freight
this.dataInfo.amount = res.total
this.dataInfo.moreAmount = res.amount
this.dataInfo.score = res.score
this.dataInfo.welfareType = res.type
this.dataInfo.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.dataInfo.content = res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.plat.platformCp = arr
this.address.addefault = res.address
this.address.allAddress = res.all_address
}).catch(err=>{
if(!err.login){
uni.showModal({
title : '用户登录已过期',
content : '请重新登录',
showCancel : false,
success : res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/auth/login'
})
}
}
})
}
})
},
// 收货地址弹出
addressTap() {
this.address.addressShow = !this.address.addressShow
},
// 选择收货地址
selectAddress(selectid, selectItem){
let new_addressId = selectid,
addressId = this.address.addefault.id
if (new_addressId != addressId) this.address.addefault = selectItem
this.address.addressShow = false
// 获取卡券列表
this.couponInfo()
},
// 商品数量加减
goodsNumber(type){
if(this.dataInfo.welfareType == 'welfare') {
uni.showToast({
title : '抱歉,只能购买一张',
icon : 'none'
})
return
}
let num = this.dataInfo.num
if (type == 'plus'){
num ++;
}else{
if (num > 1){
num --;
}else{
uni.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
}
this.dataInfo.num = num
// 获取详情
this.couponInfo()
},
// 支付选择
payBind(e) {
this.pay.payWayIndex = e.detail.value
},
// 选择提交方式
platBind(e) {
this.plat.platIndex = e.detail.value
this.plat.isdeliver = this.plat.platformCp[e.detail.value].value
// 获取详情
this.couponInfo()
},
// 支付提交
submitOrder() {
if(this.plat.isdeliver.length == 0) {
this.isdeliver = this.dataInfo.detail.def_get
}
let new_rightId = this.dataInfo.rightId,
new_welfareId = this.dataInfo.welfareId,
new_addressId = this.address.addefault.id,
new_isDeliver = this.plat.isdeliver,
new_qty = this.dataInfo.num
washcarCreate({
welfare_id: new_welfareId,
right_id: new_rightId,
address_id: new_addressId,
is_deliver: new_isDeliver,
qty: new_qty
}).then(res=>{
// 跳转收银台
uni.navigateTo({
url: "/pages/cashier/index?tradeNo=" + res.trade_no + "&price=" + this.dataInfo.amount + "&deliver=" + this.plat.isdeliver + "&activity_type=" + res.type + "&type=default"
})
}).catch(err => {});
}
}
}
</script>
<style lang="scss" scoped>
/* 重要提示 */
.rightsPoint {
position: fixed;
left: 0;
bottom: 160rpx;
background: #eeeeee;
z-index: 9;
width: 100%;
padding: 20rpx 20rpx 10rpx;
box-sizing: border-box;
.rightsPoint-cont {
width: 100%;
background: #eeeeee;
border-radius: 10rpx;
position: relative;
max-height: 50vh;
overflow-y: scroll;
.rightsPoint-top {
font-size: 28rpx;
display: flex;
padding: 0 20rpx 20rpx;
box-sizing: border-box;
font-weight: 600;
image {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
}
.rightsPoint-text {
padding: 0 20rpx;
box-sizing: border-box;
font-size: 24rpx;
line-height: 44rpx;
height: 90rpx;
transition: height 25s;
overflow: hidden;
&.active {
height: auto;
transition: 2s;
}
}
.pointMore {
text-align: center;
width: 100%;
background: #eeeeee;
height: 80rpx;
line-height: 82rpx;
position: relative;
margin-top: 10rpx;
&::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 2rpx;
background: #f2ecde;
}
text {
font-size: 28rpx;
color: #c38e00;
animation: dong 1.8s infinite;
display: inline-block;
}
image {
width: 30rpx;
height: 30rpx;
margin-left: 4rpx;
vertical-align: -4rpx;
animation: dong 1.8s infinite;
}
@keyframes dong {
0% {
transform: translate(0px, 0px);
}
50% {
transform: translate(0px, -6rpx);
}
100% {
transform: translate(0px, 0px);
}
}
&::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 2rpx;
background: #f2ecde;
}
}
}
}
// 数量
.rightsNumber {
background-color: #ffffff;
position: relative;
padding: 30rpx 40rpx;
box-sizing: border-box;
margin-bottom: 30rpx;
.rightsGoods-img {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 80rpx 40rpx 0 270rpx;
box-sizing: border-box;
.rightsGoods-text {
margin-bottom: 40rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
.rightsGoods-number {
flex: 1;
font-size: 34rpx;
text {
font-size: 28rpx;
}
}
.rightsAdd {
display: flex;
.rightsAdd-btn {
border-radius: 4rpx;
text-align: center;
width: 50rpx;
height: 50rpx;
line-height: 45rpx;
font-size: 40rpx;
font-weight: 600;
}
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input {
width: 100rpx;
text-align: center;
font-size: 28rpx;
line-height: 50rpx;
}
}
}
}
}
// 卡券权益内容
.cont {
width: 100%;
overflow: hidden;
}
.contBack {
position: relative;
width: 200%;
height: 340rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
&::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
right: 20%;
top: 55%;
width: 300rpx;
height: 300rpx;
}
.classBack {
position: absolute;
left: 28%;
right: 30%;
width: 44%;
top: 40rpx;
}
.classCircle {
position: relative;
&::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
left: 20%;
top: -20rpx;
width: 260rpx;
height: 260rpx;
}
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(28% - 2rpx);
right: calc(30% - 2rpx);
width: calc(44% + 4rpx);
top: 50rpx;
.rightsCont-tips {
color: #fff;
}
.welfareCont-top {
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 50rpx 0 20rpx;
.welfareCont-list-img {
border-radius: 50%;
width: 120rpx;
height: 120rpx;
display: inline-block;
margin: 0 15rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.rightsCont-btn {
background: rgba(255, 255, 0255, .4);
width: 100%;
line-height: 70rpx;
font-size: 40rpx;
font-weight: 600;
color: #000000;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
// 规格权益
.rightsList,
.notice,
.detailsStore {
background: white;
box-sizing: border-box;
}
.rightsLabel,
.rightsLabel-pay {
display: flex;
padding: 20rpx 30rpx;
box-sizing: border-box;
color: #6f7880;
font-size: 30rpx;
.rightsLabel-left {
flex: 1;
color: #747d86;
}
.rightsLabel-right {
display: flex;
font-size: 28rpx;
font-weight: 700;
&.rightsLabel-red{
color: #ff5b5d;
}
&.rightsLabel-score {
font-size: 34rpx;
color: #000000;
}
}
.rightsLabel-range {
display: flex;
color: #000;
font-weight: 600;
}
.rightsLabel-row {
width: 38rpx;
height: 38rpx;
margin: 2rpx 0 0 6rpx;
}
}
// 购买须知
.notice {
background: white;
padding: 20rpx;
box-sizing: border-box;
margin-top: 30rpx;
.noticeTitle {
display: flex;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
line-height: 46rpx;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 46rpx;
height: 46rpx;
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-top {
margin: 30rpx 0 10rpx;
font-weight: 600;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
// 购买按钮
.rightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100rpx;
z-index: 9;
background: #fff;
button,
text {
display: block;
margin: 12rpx 30rpx;
width: calc(100% - 60rpx) !important;
height: 74rpx !important;
line-height: 74rpx !important;
padding: 0;
background: #eacf88;
text-align: center;
border-radius: 60rpx;
font-size: 30rpx;
}
}
.newrightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 160rpx;
z-index: 9;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
text {
font-size: 38rpx;
color: #fe2d55;
}
}
button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
}
// 收货地址新增样式
.rightsLabel-address {
display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
}
.rightsLabel-address::after,
.rightsLabel-address::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
.rightsLabel-address::after {
top: 0;
}
.rightsLabel-address::before {
bottom: 0;
}
.rightsLabel-address text {
display: inline-block;
width: calc(100% - 46rpx);
}
.rightsLabel-address .rightsLabel-right {
width: calc(100% - 90rpx);
margin-left: 20rpx;
color: #000000;
}
.rightsLabel-address-text {
flex: 1;
}
.rightsLabel-address .rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel .rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
}
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
// 选择收货地址
.addressBack {
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .4);
z-index: 10;
width: 100%;
height: 100%;
display: none;
&.active {
display: block;
}
}
.addressCont {
position: fixed;
left: 0;
bottom: -1000%;
transition: .2s;
background: #fff;
z-index: 11;
width: 100%;
&.active {
bottom: 0;
}
.addressCont-title {
height: 90rpx;
line-height: 90rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 600;
position: relative;
&::after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-left {
flex: 1;
}
.addressCont-right {
color: #309ded;
}
}
.header-classify {
white-space: nowrap;
box-sizing: border-box;
height: 600rpx;
.addressCont-list {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
overflow: hidden;
position: relative;
&::after {
position: absolute;
content: '';
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-top {
display: flex;
margin-bottom: 10rpx;
.addressCont-name {
font-weight: 600;
}
}
.addressCont-text {
color: #666;
width: calc(100% - 160rpx);
}
.address-tool-icon {
width: 120rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 4rpx;
text-align: center;
color: #fff;
position: absolute;
top: 45rpx;
right: 10rpx;
background: #dfae2e;
transform: scale(.9, .9);
font-size: 24rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,707 @@
<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" v-if="this.defaultType == 'unicom'">
<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>
<radio-group @change="radioChange" v-else>
<view class="cashierCont-way-label" :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>
<view class="cashierCont-way-label" :class="{active : current == 2}" v-if="this.defaultType != 'unicom'">
<view class="payContList-label-name">
<image class="payContList-label-img" src="/static/img/wx.jpg"></image>
<text>微信支付</text>
</view>
<radio class="radio" value="2"></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://card.ysd-bs.com/unicom/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

@@ -0,0 +1,433 @@
<template>
<view>
<!-- 权益数据 -->
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://card.ysd-bs.com/storage/materials/2021/09/01/class_back_01.png" mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont">
<view class="rightsCont-tips" v-if="infoData.two_title != null">
{{ infoData.two_title }}
</view>
<view class="nowrap rightsCont-title">
{{ infoData.three_title == null ? '' : infoData.three_title }}
</view>
<view class="nowrap rightsCont-btn">
{{ infoData.two_description }}
</view>
</view>
</view>
</view>
<!-- 公告 -->
<view class="indexNews">
<image src="/static/icon/news_icon.png"></image>
<view class="marquee_container" style="--marqueeWidth--:-30em">
<view class="marquee_text" :class="{active : noticeData.length > 20}">{{ noticeData }}</view>
</view>
</view>
<!-- 卡券专区 -->
<view class="special">
<view class="special-title">卡券专区</view>
<view class="special-list">
<block v-if="infoItems.length > 0">
<view class="special-label" v-for="(item,index) in infoItems" :key="index" @click="rightNav(item.right_config_id, item.from)">
<view class="special-rebate" v-if="item.label != ''">{{ item.label }}</view>
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<block v-if="item.logos != ''">
<view class="welfareCont-list-img" v-for="(items,indexItem) in item.logos" :key="indexItem">
<image :src="items" mode="aspectFill"></image>
</view>
</block>
<block v-else>
<view class="welfareCont-list-img">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/14/defaultImg.png" mode="aspectFill"></image>
</view>
</block>
</scroll-view>
<view class="special-text">
<view class="nowrap special-name">{{ item.title }}</view>
<view class="special-tips">{{ item.subtitle }}</view>
</view>
</view>
</block>
<block v-else>
<view class="legalTips">
<image src="/static/img/null_icon.png"></image>
<text>抱歉, 暂无内容</text>
</view>
</block>
</view>
</view>
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @click="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读内容介绍
</view>
<image class="noticeTitle-row" :class="{active : contentShow}" src="/static/icon/arrow_right_black.png"></image>
</view>
<view class="noticeText" :class="{active : contentShow}">
<view class="noticeText-cont">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
</view>
</template>
<script>
import { classify, washcarUrl } from '@/apis/interfaces/rights'
export default {
data() {
return {
noticeData : '', // 公告
infoData : '', // 权益数据
infoItems : '', // 卡券专区
content : '', // 内容简介
contentShow: false // 内容简介-显示状态
}
},
onLoad(options) {
this.indexNav(options.id,options.areaname,options.latitude,options.userlng)
},
methods:{
// 卡权益分类
indexNav(id, areaname,latitude,userlng) {
classify(id, {
area_name: areaname,
user_lng : latitude,
user_lat : userlng
}).then(res=>{
this.noticeData = res.notice
this.infoData = res.info
this.infoItems = res.items
this.content = res.info.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err=>{
if(!err.login){
// 写入缓存
uni.setStorage({
key : 'token',
data : ''
})
}
})
},
// 须知展开收起状态
noticeTap() {
this.contentShow = !this.contentShow
},
// 活动中心权益跳转详情
rightNav(rightid,rightfrom) {
if(uni.getStorageSync("token")) {
if(rightfrom == 'washcar') {
// 先做成固定跳转
// uni.navigateTo({
// url: "/pages/car/index?welfare_id=" + "&right_id=" +rightid
// })
// return
washcarUrl({
welfare_id : '',
right_config_id : rightid
}).then(res=>{
const newUrl = res
let url= encodeURIComponent(newUrl)
uni.redirectTo({
// 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}`
});
})
} else {
// 跳转分类页
uni.navigateTo({
url: '/pages/rights/index?id=' + rightid
})
}
return
}
uni.navigateTo({
url: "/pages/auth/login"
})
}
}
}
</script>
<style lang="scss" scoped>
// 权益数据
.cont {
width: 100%;
overflow: hidden;
.contBack {
position: relative;
width: 200%;
height: 400rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
&::after {
width: 100%;
height: 30rpx;
position: absolute;
left: 0;
bottom: 0;
z-index: 2;
content: '';
background-image: linear-gradient(transparent, rgba(0,0,0,.25));
}
&::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
.classBack {
position: absolute;
left: 30%;
right: 30%;
width: 40%;
top: 40rpx;
}
.classCircle {
position: relative;
&::after {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(30% - 2rpx);
right: calc(30% - 2rpx);
width: calc(40% + 4rpx);
top: 58rpx;
.rightsCont-tips {
color: #fff;
}
.rightsCont-title {
color: #63320a;
font-size: 60rpx;
margin: 60rpx 0 20rpx;
padding: 0 20rpx;
box-sizing: border-box;
}
.rightsCont-btn {
background-color: #f4dfcc;
width: 100%;
line-height: 70rpx;
font-size: 38rpx;
color: #2d2d2d;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
}
// 公告
.indexNews {
display: flex;
font-size: 28rpx;
line-height: 46rpx;
background: #c4c4c4;
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
margin: 30rpx 20rpx;
image {
width: 42rpx;
height: 42rpx;
margin: 4rpx 20rpx 0 0;
}
.marquee_container {
width: calc(100% - 40rpx);
overflow: hidden;
&:hover {
/* 不起作用 */
animation-play-state: paused;
}
.marquee_text {
font-size: 28rpx;
display: inline-block;
white-space: nowrap;
&.active {
animation-name: around;
animation-duration: 20s;
/*过渡时间*/
animation-iteration-count: infinite;
animation-timing-function: linear;
}
/*首页跑马灯效果*/
@keyframes around {
from {
margin-left: 60rpx;
}
to {
/* var接受传入的变量 */
margin-left: var(--marqueeWidth--);
}
}
}
}
}
// 卡券专区
.special {
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
background: #fff;
margin: 30rpx 20rpx;
.special-list {
margin: 20rpx -10rpx 0;
flex-wrap: wrap;
display: flex;
.special-label {
margin: 10rpx;
width: calc(50% - 20rpx);
height: 330rpx;
flex: 0 0 calc(50% - 20rpx);
border: 4rpx solid #fb9b00;
background-color: #ffe0b8;
border-radius: 10rpx;
text-align: center;
padding: 20rpx 0;
box-sizing: border-box;
position: relative;
.special-rebate {
position: absolute;
top: -30rpx;
right: 10rpx;
background: #fe0002;
color: #fff;
border-radius: 30rpx;
line-height: 52rpx;
height: 52rpx;
font-size: 26rpx;
padding: 0 20rpx;
font-weight: 600;
}
.welfareCont-top {
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 10rpx 0;
.welfareCont-list-img {
border: 2rpx solid #eccc69;
border-radius: 50%;
width: 100rpx;
height: 100rpx;
display: inline-block;
margin: 0 10rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.special-text {
padding: 0 15rpx;
box-sizing: border-box;
position: relative;
font-size: 26rpx;
border-top: 4rpx dashed #fb9b00;
margin-top: 20rpx;
padding-top: 20rpx;
.special-name {
color: #6f4a2d;
font-weight: 600;
font-size: 28rpx;
}
.special-tips {
background-color: #242424;
color: #fff;
border-radius: 10rpx;
padding: 4rpx 20rpx;
line-height: 46rpx;
height: 46rpx;
margin-top: 20rpx;
font-size: 24rpx;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
// 内容介绍
.notice {
border-radius: 10rpx;
padding: 25rpx 20rpx;
box-sizing: border-box;
background: #c4c4c4;
margin: 30rpx 20rpx;
.noticeTitle {
color: #747d86;
display: flex;
line-height: 46rpx;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
color: #000;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 32rpx;
height: 32rpx;
margin-top: 6rpx;
transform:rotate(-180deg);
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
/* 权益提示 */
.legalTips {
text-align: center;
font-size: 26rpx;
color: #999;
image {
width: 180rpx;
height: 180rpx;
display: block;
margin: 0 auto;
}
}
</style>

View File

@@ -0,0 +1,374 @@
<template>
<view class="content">
<view class="codeTitle">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/code_title.png" mode="widthFix"></image>
</view>
<view class="codeCont">
<view class="codeCont-tisp">
<text>每邀请一位好友注册成功后</text>
<text>您将获得30元消费红包奖励</text>
</view>
<view class="codeCont-text">
<image class="codeCont-avatar" :src="userInfo.avatar" mode="aspectFill"></image>
<view class="codeCont-name">
{{ userInfo.nickname }}
</view>
</view>
<view class="codeCont-code">
<view class="codeCont-title">
<view class="codeCont-title-text">邀好友享福利</view>
<view class="codeCont-title-tips">邀请好友加入本时生活</view>
</view>
<image class="codeCont-img" :src="qrcode" mode="aspectFill"></image>
<view class="codeShare-label" @tap="saveImg" hover-class="none">生成海报</view>
</view>
</view>
<!-- 海报canvas -->
<canvas class="canvasImg" canvas-id="qrcodeCard"></canvas>
<!-- 图片弹出层 -->
<view class="user-lay sign-img-lay" v-if="isImgLay">
<view class="user-back">
<image class="user-back-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/code_share.png" mode="widthFix"></image>
<view class="user-back-cont">
<view class="codeBack-yard-name">
<view class="codeBack-yard-title">扫码享福利</view>
<view>邀请好友加入本时生活</view>
</view>
<image :src="qrcode" mode="aspectFill"></image>
</view>
</view>
<view class="sign-img-btn" @tap="saveImg">长按图片保存二维码<image class="longpress" src="/static/img/long_press.png" mode="widthFix"></image></view>
<button class="sign-img-btn remove-btn" size="mini" @tap="removeSaveImg">取消</button>
</view>
</view>
</template>
<script>
import { myshare } from '@/apis/interfaces/user'
export default {
data() {
return {
qrcode : '', //二维码
userInfo: '', //我的信息
isImgLay: false, //是否显示图片弹出层
parentId: '' ,//是否分享进入
qrcodeImg: '' //海报图片
}
},
onLoad(options) {},
onShow() {
myshare({
channel: "h5",
parent_id: '',
url: 'pages/index/index?type=shareLogin'
}).then(res=>{
this.qrcode = res.qrcode
this.userInfo = res.user
}).catch(err=>{})
},
methods: {
// 绘图
dowImg(){
uni.showLoading({
title: '加载中',
})
let avatarImg = new Promise(success=>{
uni.getImageInfo({
src : this.userInfo.avatar,
success : res => {
success(res.path)
}
})
})
// 下载素材
let codeImg = new Promise(success => {
uni.getImageInfo({
src : this.qrcode,
success : res => {
success(res.path)
}
})
})
Promise.all([codeImg, avatarImg]).then(res => {
// 绘制海报
const ctx = uni.createCanvasContext('qrcodeCard')
ctx.save()
// 绘制背景
ctx.setFillStyle('#f7662d')
ctx.fillRect(0, 0, 375, 603)
// 绘制背景
ctx.drawImage('/static/img/user-codeImg-down.png', 0, 0, 375, 650)
// 绘制二维码
ctx.drawImage(res[0], 114, 390, 150, 150)
// 文字
ctx.setFontSize(16)
ctx.setFillStyle("#2f3245")
ctx.setTextAlign('center')
ctx.fillText(this.userInfo.nickname, 194, 350 , 270)
// 文字
ctx.setFontSize(14)
ctx.setFillStyle("#af7700")
ctx.setTextAlign('center')
ctx.fillText(this.userInfo.nickname + " -- " + "邀请您进入本时生活", 188, 570 , 270)
ctx.save();
ctx.beginPath(); //开始绘制
ctx.arc(70 / 2 + 156, 70 / 2 + 250, 70 / 2, 0, Math.PI * 2, false);
ctx.clip();
ctx.drawImage(res[1], 156, 250, 70, 70);
// 保存图片
ctx.draw(true, () => {
uni.hideLoading()
uni.canvasToTempFilePath({
canvasId: 'qrcodeCard',
x: 0,
y: 0,
success: res => {
this.qrcodeImg = res.tempFilePath
this.removeSaveImg()
}
})
})
}).catch(err=>{
uni.showToast({
title: '海报下载,请检查网络',
icon : 'none'
})
})
},
// 图片弹出层
removeSaveImg(){
this.isImgLay = !this.isImgLay
},
// 绘制海报
saveImg(){
this.dowImg();
},
}
}
</script>
<style>
page {
background-color: #e2e2e2;
}
/* 按钮 */
.codeShare {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
background-color: #333333;
display: flex;
padding: 30rpx 20rpx 40rpx;
box-sizing: border-box;
z-index: 9;
}
.codeShare-label {
width: calc(100% - 80rpx) !important;
margin: 30rpx 40rpx;
font-weight: normal;
text-align: center;
height: 86rpx;
line-height: 86rpx;
padding: 0;
border-radius: 60rpx;
font-size: 32rpx;
color: #ffffff;
background: #000000;
}
.codeShare-button {
color: #ffd887;
background: transparent;
}
page {
background-color: #e2e2e2;
}
.content {
overflow: hidden;
}
.codeTitle {
width: 100%;
background-color: #000000;
border-radius: 0 0 200rpx 200rpx;
padding: 40rpx 20rpx 160rpx;
box-sizing: border-box;
}
.codeTitle {
text-align: center;
width: 100%;
}
.codeCont {
background-color: #ffffff;
margin: -120rpx auto 0;
width: 84%;
border-radius: 20rpx;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
padding: 40rpx 0;
}
.codeCont-tisp {
text-align: center;
color: #fff;
background-color: #797979;
padding: 10rpx 0;
}
.codeCont-tisp text {
display: block;
}
.codeCont-text {
text-align: center;
margin: 40rpx 0;
}
.codeCont-avatar {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
margin-bottom: 20rpx;
}
.codeCont-code {
text-align: center;
}
.codeCont-img {
width: 300rpx;
height: 300rpx;
}
.codeCont-title {
margin-bottom: 20rpx;
}
.codeCont-title-text {
font-size: 46rpx;
font-weight: 700;
margin-bottom: 10rpx;
letter-spacing: 4rpx;
}
.codeCont-title-tips {
font-size: 28rpx;
}
/* 弹窗背景图 */
.user-lay {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
background: rgba(0, 0, 0, .6);
height: 100vh;
width: 100vw;
top: 0;
left: 0;
z-index: 99;
box-sizing: border-box;
}
/* canvas */
.canvasImg {
position: absolute;
left: -1000%;
bottom: 0;
height: 650px;
width: 375px;
background: #fbf6f0;
}
/* 图片弹出层 */
.sign-img-lay {
text-align: center;
}
.sign-img-src {
width: 70vw;
vertical-align: top;
}
.sign-img-btn {
margin: 0 auto 40rpx;
background: #ffffff;
font-weight: normal;
color: #2f3245;
height: 90rpx;
line-height: 90rpx;
padding: 0;
width: 80%;
}
.longpress {
width: 40rpx;
height: 40rpx;
vertical-align: middle;
margin-left: 10rpx;
}
.remove-btn {
margin-top: 20rpx;
background: #101010;
color: #e5c175;
font-weight: normal;
}
/* 背景 */
.user-back-img {
width: 100%;
display: block;
}
.user-back {
position: relative;
width: 80%;
text-align: center;
margin: 0 auto;
}
.user-back-cont {
text-align: center;
background-color: #e2e2e2;
padding: 40rpx 0;
}
.user-back-cont image {
width: 300rpx;
height: 300rpx;
}
.codeBack-yard-name {
margin-bottom: 30rpx;
}
.codeBack-yard-title {
font-size: 50rpx;
font-weight: 600;
letter-spacing: 4rpx;
margin-bottom: 20rpx;
}
</style>

View File

@@ -0,0 +1,322 @@
<template>
<view>
<!-- 我的卡券 -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : label.stateType == item.used}" v-for="(item,index) in label.couponLabel" :key="index" @click="orderTab(item.used)">
{{ item.title }}
<view v-if="item.used == 0">({{ couponData.count.init }})</view>
<view v-else-if="item.used == 1">({{ couponData.count.used }})</view>
<view v-else>({{ couponData.count.pass }})</view>
</view>
</view>
<!-- 卡券列表 -->
<view class="coupon" v-if="couponData.couponArr != ''">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item,index) in couponData.couponArr" :key="index">
<view class="couponList" @click="couponUrl(item.coupon_id, item.from, item.status)">
<view class="couponList-left">
<image class="couponList-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{ item.activity_name }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{ item.used_at }}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips_01.png" class="coupoTips"></image>
</view>
<view class="couponMore" v-if="item.count > 1">
<view class="couponMore-text" @click="couponTap(item.activityId, item.status)">
<view class="couponMore-title">查看全部{{item.count}}张卡券</view>
<image class="couponMore-arrow" src="/static/icon/arrow_left.png"></image>
</view>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { coupon, washcarCoupon } from '@/apis/interfaces/user'
export default {
data() {
return {
label : {
stateType : '0', // 卡券状态
couponLabel : [
{ title : "未使用", used: 0 },
{ title : "已使用", used: 1 },
{ title : "已过期", used: 2 }
]
},
couponData: {
couponArr : '', // 卡券列表
coupons : [],
count : '', // 卡券数量
}
}
},
onLoad(options) {
},
onShow () {
// 获取卡券列表
this.couponInfo();
},
methods:{
// 卡券列表
couponInfo() {
coupon(this.label.stateType).then(res=>{
this.couponData.count = res.count
this.couponData.couponArr = res.list
})
},
// 卡券tabs
orderTab(used){
if(this.label.stateType != used){
this.label.stateType = used
// 获取卡权益
this.couponInfo()
}
},
// 跳转优惠券分组
couponTap(id, status) {
uni.navigateTo({
url: '/pages/couponArr/couponArr?id=' + id + '&status=' + status
})
},
// 优惠券跳转
couponUrl(newId, newFrom, newStatus) {
if(newStatus == 0) {
if(newFrom == 'washcar') {
washcarCoupon(newId).then(res=>{
const newUrl = res.data
let url= encodeURIComponent(newUrl)
uni.redirectTo({
// 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}`
});
}).catch(err=>{
if(!err.login){
// 写入缓存
uni.setStorage({
key : 'token',
data : ''
})
}
})
return
}
uni.navigateTo({
url: '/pages/couponDetails/couponDetails?id=' + newId
})
}
}
}
}
</script>
<style lang="scss" scoped>
// 优惠券tab
.couponTab {
display: flex;
background: #fff;
position: fixed;
width: 100%;
left: 0;
height: 100rpx;
top: 0;
z-index: 99;
.couponTab-label {
flex: 3;
text-align: center;
position: relative;
padding: 10rpx 0 0;
font-size: 26rpx;
&::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
width: 40rpx;
background: transparent;
height: 6rpx;
border-radius: 30%;
}
&.active {
color: #f57e32;
}
view {
font-size: 24rpx;
margin-top: 6rpx;
}
}
}
// 卡券列表
.coupon {
margin-top: 70px;
.couponCont {
margin: 0 20rpx 20rpx;
width: calc(100% - 40rpx);
border-radius: 10rpx;
overflow: hidden;
.couponList {
background: #fff;
width: 100%;
height: 160rpx;
position: relative;
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius: 50%;
padding: 20rpx;
box-sizing: border-box;
image {
width: 100%;
height: 100%;
}
}
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 18rpx;
width: calc(100% - 330rpx);
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
}
.couponList-time,
.couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-top: 14rpx;
color: grey;
}
}
.couponList-right {
background: #ee8e44;
color: #fff;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
&.active {
background: #dddddd;
}
}
}
.couponMore {
font-size: 28rpx;
color: #686868;
position: relative;
height: 120rpx;
&::after,
&::before {
position: absolute;
content: '';
height: 20rpx;
border-radius: 10rpx;
background: #fff;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
z-index: 1;
height: 30rpx;
}
&::after {
width: calc(100% - 40rpx);
top: 70rpx;
left: 20rpx;
}
&::before {
width: calc(100% - 80rpx);
top: 90rpx;
left: 40rpx;
}
.couponMore-text {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 99;
height: 80rpx;
border-radius: 0 0 10rpx 10rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
.couponMore-title {
flex: 1;
}
.couponMore-arrow {
width: 28rpx;
height: 28rpx;
margin-top: 26rpx;
}
}
}
&.active .couponList-img,
&.active .couponList-icon {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
}
}
</style>

View File

@@ -0,0 +1,202 @@
<template>
<view>
<!-- 卡券列表 -->
<view class="coupon" v-if="couponArr.length > 0">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item,index) in couponArr" :key="index" @click="couponUrl(item.id, item.from, item.status)">
<view class="couponList">
<view class="couponList-left">
<image class="couponList-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{ item.activity_name }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{ item.used_at }}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips_01.png" class="coupoTips"></image>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { couponArr } from '@/apis/interfaces/user'
export default {
data() {
return {
couponId : '', // 卡券id
couponArr : [], // 卡券列表
status : '', // 卡券状态
load: {
page : 1, // 第一页
allpage : 0, // 总页数
has_more: false, // 是否有分页
show : false // 是否有下一页数据
},
finished : false, // 商品列表没有更多商品是否显示
LoadData : false // 数据加载完渲染
}
},
onLoad(options) {
this.couponId = options.id,
this.status = options.status
// 获取卡券组列表
this.couponInfo();
},
methods:{
// 卡券组列表
couponInfo() {
if (this.load.page == 1) {
this.couponArr = [];
}
couponArr({
activityId: this.couponId,
status : this.status,
page : this.load.page
}).then(res=>{
this.couponArr = this.couponArr.concat(res.data)
this.load.allpage = res.page.total_page
this.load.has_more = res.page.has_more
// 数据渲染加载
this.LoadData = true
})
},
// 优惠券跳转
couponUrl(newId, newFrom, newStatus) {
if(newStatus == 0) {
if(newFrom == 'washcar') {
washcarCoupon(newId).then(res=>{
const newUrl = res.data
let url= encodeURIComponent(newUrl)
uni.redirectTo({
// 跳转到webview页面
url: `/pages/washcar/washcar?url=${url}`
});
}).catch(err=>{
if(!err.login){
// 写入缓存
uni.setStorage({
key : 'token',
data : ''
})
}
})
return
}
uni.navigateTo({
url: '/pages/couponDetails/couponDetails?id=' + newId
})
}
}
}
}
</script>
<style lang="scss" scoped>
// 卡券列表
.coupon {
padding: 20rpx 0;
.couponCont {
margin: 0 20rpx 20rpx;
width: calc(100% - 40rpx);
border-radius: 10rpx;
overflow: hidden;
.couponList {
background: #fff;
width: 100%;
height: 160rpx;
position: relative;
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius:50%;
padding: 20rpx;
box-sizing: border-box;
image {
width: 100%;
height: 100%;
}
}
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 16rpx;
width: calc(100% - 330rpx);
.active {
top: 15rpx;
}
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
}
.couponList-time, .couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-top: 14rpx;
}
}
.couponList-right {
background: #ee8e44;
color: #fff;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,387 @@
<template>
<view>
<!-- 卡券详情 -->
<view class="details">
<view class="detailsTop">
<view class="detailsTop-name">
{{ coupon.details.name }}
</view>
<view class="detailsTop-time">
有效期 {{ coupon.details.startTime }} - {{ coupon.details.endTime }}
</view>
</view>
<view class="source">活动来源 {{ coupon.details.activity_name }}</view>
<view class="detailsBar">
<view class="detailsCode-text">劵码</view>
<image :src="code.barcode" mode="widthFix"></image>
</view>
<view class="detailsCode-text">
{{ coupon.details.code }}
</view>
<view class="detailsCode">
<image :src="code.qrcode"></image>
<view class="detailsCode-text">
<text>请出示以上券码给网点工作人员</text>
</view>
</view>
<!-- 门店定位 -->
<view class="detailsStore">
<view class="detailsStore-top">
<view class="detailsStore-title">
适用门店
</view>
<navigator class="detailsStore-row" hover-class="none" :url="'/pages/store/index?id=' + coupon.details.id" v-if="location.longitude != 0 && location.latitude != 0">
查看所有
<image src="/static/icon/arrow_left.png"></image>
</navigator>
</view>
<view class="location" v-if="location.longitude == 0 && location.latitude == 0">
<image class="location-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/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="coupon.stores != ''">
<view class="detailsStore-list" v-for="(item,index) in coupon.stores" :key="index"
@click="detailsTap(item.store_id)">
<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" @click.stop="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>
</view>
<!-- 使用须知 -->
<view class="detailsText">
<view class="detailsText-title">
使用须知
</view>
<view class="detailsText-tips">
<rich-text :nodes="coupon.remark"></rich-text>
</view>
</view>
<!-- 内容介绍 -->
<view class="detailsText">
<view class="detailsText-title">
内容介绍
</view>
<view class="detailsText-tips" v-if="coupon.content != null">
<rich-text :nodes="coupon.content"></rich-text>
</view>
</view>
</view>
</template>
<script>
import { couponinfo, merchant_card, qrcode, barcode } from '@/apis/interfaces/user'
export default {
data() {
return {
coupon : {
couponId : '', // 优惠券id
details : '', // 优惠券信息
stores : [], // 商家列表
remark : '', // 使用须知
content : '', // 内容介绍
},
code : {
qrcode : '', //二维码
barcode : '', //条形码
},
location : {
latitude : 126.66837, // 纬度
longitude: 45.76021 // 经度
}
}
},
onLoad(options) {
this.coupon.couponId = options.id
// 获取二维码
this.detailsCode()
// 获取条形码
this.detailsBarcode()
},
onShow () {
// 查看定位信息
this.getCity();
},
methods:{
// 详情信息
detailsInfo() {
couponinfo({
coupon_id: this.coupon.couponId,
user_lng : this.location.longitude,
user_lat : this.location.latitude
}).then(res=>{
let stores = res.stores
stores.map(res=>{
let distance = res.distance
if(res.distance > 1000){
distance = (distance / 1000) + "km"
}else{
distance = distance + "m"
}
res.km = distance
})
this.coupon.details = res.info
this.coupon.stores = stores
this.coupon.remark = res.info.right.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.coupon.content = res.info.right.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
})
},
// 获取城市信息
getCity(){
uni.getLocation({
success: res => {
this.location.latitude   = res.latitude,
this.location.longitude  = res.longitude
},
complete: (err) => {
// 获取详情信息
this.detailsInfo();
}
})
},
// 二维码
detailsCode() {
qrcode(this.coupon.couponId).then(res=>{
this.code.qrcode = res.qrcode
})
},
// 条形码
detailsBarcode() {
barcode(this.coupon.couponId).then(res=>{
this.code.barcode = res.barcode
})
},
// 拨打电话
tel(number) {
uni.showActionSheet({
itemList : ['呼叫商家电话'],
success : res =>{
if(res.tapIndex==0){
uni.makePhoneCall({
phoneNumber: number
})
}
}
})
},
// 查看门店详情页
detailsTap(id) {
uni.navigateTo({
url: '/pages/store/details?store_id=' + id + '&user_lng=' + this.location.longitude + '&user_lat=' + this.location.latitude,
})
},
}
}
</script>
<style lang="scss" scoped>
/* 卡券详情 */
.details {
background: #fff;
margin: 20rpx;
width: calc(100% - 40rpx);
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
.detailsTop {
border-bottom: 2rpx dashed #c8c8c8;
padding-bottom: 40rpx;
.detailsTop-name {
font-size: 36rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsTop-time {
color: #7e7e7e;
font-size: 26rpx;
}
}
.source{
margin: 30rpx 0;
font-size: 28rpx;
}
.detailsBar {
text-align: center;
padding: 0 50rpx;
box-sizing: border-box;
margin-top: 60rpx;
margin-bottom: 40rpx;
image {
width: 100%;
}
.detailsCode-text {
margin-bottom: 10px;
color: #000;
}
}
.detailsCode-text {
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #000;
text {
color: #999;
font-weight: normal;
font-size: 26rpx;
}
}
.detailsCode {
text-align: center;
padding: 0 0 20rpx;
margin: 40rpx 0 30rpx;
image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
}
.detailsStore {
border-top: 2rpx #c8c8c8 solid;
padding-top: 40rpx;
.detailsStore-top {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
.detailsStore-title {
flex: 1;
font-weight: 600;
}
}
.location {
background: white;
width: 100%;
text-align: center;
margin: 60rpx 0 0;
text {
font-size: 28rpx;
display: block;
line-height: 46rpx;
color: #999;
}
.location-img {
width: 150rpx;
height: 120rpx;
margin-bottom: 20rpx;
}
.location-btn[size="mini"] {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 66rpx;
margin-top: 30rpx;
}
}
}
}
.detailsText {
padding: 30rpx 30rpx 20rpx;
box-sizing: border-box;
.detailsText-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsText-tips {
font-size: 26rpx;
line-height: 50rpx;
color: #555557;
padding-bottom: 20rpx;
}
}
// 门店
.detailsStore-title {
flex: 1;
font-weight: 600;
}
.detailsStore-top, .detailsStore-row {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
}
.detailsCode-text, .detailsStore-row {
color: #949494;
font-size: 28rpx;
}
.detailsStore-row image {
width: 26rpx;
height: 26rpx;
margin: 3rpx 0 0 6rpx;
}
.detailsStore-list {
position: relative;
margin-bottom: 40rpx;
.detailsStore-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.detailsStore-cont {
position: absolute;
left: 130rpx;
top: 0;
width: calc(100% - 130rpx);
display: flex;
.detailsStore-left {
width: calc(100% - 90rpx);
margin-right: 30rpx;
.detailsStore-name {
margin-bottom: 20rpx;
}
.detailsStore-place {
font-size: 24rpx;
line-height: 40rpx;
color: #5a5a5a;
display: flex;
text {
flex: 1;
display: inline-block;
font-size: 28rpx;
margin-right: 20rpx;
}
}
}
.detailsStore-tel {
width: 60rpx;
height: 60rpx;
margin-top: 25rpx;
}
}
}
</style>

View File

@@ -0,0 +1,515 @@
<template>
<view class="content">
<view class="borderBottom">
<view class="title">
<image class="title-img" src="/static/img/draw_choose.png"></image>
<view class="title-top">
选择商品兑换
</view>
</view>
<view class="choose">
<view class="choose-radio-group">
<radio-group class="choose-label" :class="{active : current == 1}" @change="(e) => radioChange(e,index,item)" v-for="(item, index) in goodsArr" :key="index">
<view class="choose-label-name">
<image class="choose-label-img" :src="item.cover"></image>
<view class="choose-label-text">
<view class="choose-label-title">
{{item.title}}
<text>基于能监测健康的手环</text>
</view>
<view class="choose-label-price">
<text></text>{{item.price}}
</view>
</view>
</view>
<radio class="radio" :value="String(item.exchagne_item_goods_id)" :checked="index == current"></radio>
</radio-group>
</view>
<view class="chooseForm">
<view class="site-input">
<label>收货人姓名</label>
<input class="campus-form-input" maxlength="4" type="text" placeholder="请输入收货人姓名" @input="getNameValue" name="name" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="site-input">
<label>收货人手机</label>
<input class="campus-form-input" maxlength="11" type="number" placeholder="请输入收货人手机号" @input="getTelValue" name="mobile" placeholder-style="color:#c9c9c9;"></input>
</view>
<!-- <view class="site-input">
<label>所在省份</label>
<picker @change="areasChange" :value="area.areaIndex" :range="area.areas" :range-key="'name'" name="province_id">
<view class="picker" v-if="area.areas[area.areaIndex]">
{{ area.areas[area.areaIndex].name }}
</view>
<image src="/static/icon/rightsArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>所在城市</label>
<picker @change="cityDrop" :value="city.cityIndex" :range="city.cityList" :range-key="'name'" class="conneColor" name="city_id">
<view class="picker" v-if="city.cityList[city.cityIndex]">
{{ city.cityList[city.cityIndex].name }}
</view>
<image src="/static/icon/rightsArrow.png"></image>
</picker>
</view>
<view class="site-input">
<label>所在区域</label>
<picker @change="regiDrop" :value="regi.regiIndex" :range="regi.regiList" :range-key="'name'" class="conneColor" name="district_id">
<view class="picker" v-if="regi.regiList[regi.regiIndex]">
{{ regi.regiList[regi.regiIndex].name }}
</view>
<image src="/static/icon/rightsArrow.png"></image>
</picker>
</view> -->
<view class="site-input">
<label>收货地址</label>
<input placeholder="请输入收货详细地址" name="address" @input="getAddressValue" placeholder-style="color:#c9c9c9;"></input>
</view>
</view>
</view>
</view>
<view class="chooseBuy">
<view class="chooseBuy-price">
{{goodTitle}}<text>{{goodPay == 0 ? '免费兑换' : '支付金额: ¥' + goodPrice}}</text>
</view>
<button type="default" class="chooseBuy-btn" @click="siteform">
兑换
</button>
</view>
</view>
</template>
<script>
import { exchanges, exchangesBuy } from '@/apis/interfaces/draw'
import { create, children } from '@/apis/interfaces/address'
import { getAuthUrl, wpayH5Info, h5Pay } from '@/apis/interfaces/rights'
const jweixin = require('jweixin-module'); //获取微信支付
export default {
data() {
return {
logId : '', //抽奖记录
tradeNo : '', //产品支付订单号
goodsArr : [], //产品列表
goodId : '', //产品id
goodTitle : '', //产品名称
goodPrice : '', //产品金额
goodPay : '', //产品是否支付
current : 0 , //支付下标
address : '', // 地址内容
name : '', // 姓名
mobile : '', // 手机号
// 省份选择
area: {
areas : [],
areaSn : '',
areaIndex : 0,
},
// 市级选择
city: {
cityList : [],
cityId : 0,
cityIndex : 0,
},
// 区域选择
regi: {
regiList : [],
regiId : 0,
regiIndex : 0,
}
}
},
// 生命周期函数--监听页面加载
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.exchangesShow(options.id)
},
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
// 获取省信息
// this.getProvince()
},
methods: {
// 微信支付数据
wechatPayment() {
let status = navigator.userAgent.toLowerCase();
if (status.match(/MicroMessenger/i) == "micromessenger") {
// 微信浏览器-获取
this.wxBrowser();
}else {
// 普通浏览器(网址游览器)
this.outBrowser();
}
},
// 商品选择
exchangesShow(id){
exchanges(id).then(res=>{
this.logId = res.exchage_log_id
this.goodsArr = res.exchange_item.goods
this.goodId = res.exchange_item.goods[0].exchagne_item_goods_id
this.goodTitle = res.exchange_item.goods[0].title
this.goodPrice = res.exchange_item.goods[0].price
this.goodPay = res.exchange_item.goods[0].is_buy
})
},
// 支付方式选择
radioChange(evt, index, item) {
this.goodTitle = item.title
this.goodPay = item.is_buy
this.goodPrice = item.amount
this.current = index
this.goodId = evt.detail.value
},
// 省信息
getProvince() {
create().then(res=>{
let areaArr = res.provinces,
areaIndex = this.area.areaIndex
this.area.areaSn = areaArr[areaIndex].code
this.area.areas = areaArr
this.citylist(areaArr[areaIndex].code)
})
},
// 所在省份
areasChange(e) {
let area = this.area.areas,
index = e.detail.value,
atcode = area[index].code
if (index != this.area.areaIndex) {
this.area.areaIndex = index
this.area.areaSn = atcode
// 获取市级列表
this.citylist(atcode)
}
},
// 市级列表
citylist(code) {
children(code).then(res=>{
let cityArr = res
this.city.cityId = cityArr[0].code
this.city.cityList = cityArr
this.city.cityIndex = 0
this.regilist(cityArr[0].code)
})
},
// 市级下拉筛选
cityDrop(e) {
let city = this.city.cityList,
index = e.detail.value,
citycode = city[index].code
if (index != this.area.areaIndex) {
this.city.cityIndex = index
this.city.cityId = citycode
// 获取市级列表
this.regilist(citycode)
}
},
// 区列表
regilist(areaCode) {
children(areaCode).then(res=>{
this.regi.regiList = res
this.regi.regiId = res[0].code
this.regi.regiIndex = 0
})
},
// 区下拉筛选
regiDrop(e) {
let newIndex = e.detail.value
this.regi.regiIndex = newIndex
this.regi.regiId = this.regi.regiList[newIndex].code
},
// 获取用户名
getNameValue(e) {
this.name = e.detail.value
},
// 获取手机号
getTelValue(e) {
this.mobile = e.detail.value
},
// 获取详细地址
getAddressValue(e) {
this.address = e.detail.value
},
// 提交表单
siteform() {
exchangesBuy({
name : this.name,
mobile : this.mobile,
address : this.address,
activity_exchange_log_id: this.logId,
activity_exchange_item_goods_id: this.goodId,
qty : 1
}).then(res=>{
if(res.need_buy) {
this.tradeNo = res.trade_no
this.wxBrowser()
return
}
// 跳转兑换成功页
uni.redirectTo({
url: 'success'
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
},
// 当支付环境为微信游览器情况下
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(() => {
let wechaUrl = 'payments/wechat'
h5Pay(wechaUrl, {
channel: 'h5',
trade_no: this.tradeNo,
code: this.code
}).then(wechatRes => {
let wechatPay = JSON.parse(wechatRes)
console.log("wechatPay")
jweixin.chooseWXPay({
timestamp: wechatPay.timeStamp,
nonceStr: wechatPay.nonceStr,
package: wechatPay.package,
signType: wechatPay.signType,
paySign: wechatPay.paySign,
success: payRes => {
console.log(payRes)
},
cancel: () =>{
}
})
})
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
if (!err.login) {
uni.reLaunch({
url: '/pages/draw/signin'
});
}
})
},
}
}
</script>
<style lang="scss">
.content {
padding: 30rpx 20rpx;
box-sizing: border-box;
}
.borderBottom {
border-bottom: 110rpx solid transparent;
}
.title {
position: relative;
width: 100%;
background-color: #2564ff;
height: 100rpx;
border-radius: 10rpx;
.title-img {
width: 100%;
height: 100%;
position: absolute;
height: 100rpx;
left: 0;
top: 0;
}
.title-top {
width: 100%;
height: 100%;
line-height: 100rpx;
position: absolute;
left: 0;
top: 0;
z-index: 9;
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
}
}
.choose {
margin: 30rpx -10rpx 0;
overflow: hidden;
.choose-radio-group {
overflow: hidden;
}
.choose-label {
width: calc(50% - 20rpx);
float: left;
margin: 0 10rpx;
border-radius: 10rpx;
background-color: #FFFFFF;
margin-bottom: 30rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
position: relative;
.choose-label-name {
.choose-label-img {
width: 100rpx;
height: 100rpx;
}
}
.radio {
position: absolute;
top: 20rpx;
right: 10rpx;
}
.choose-label-text {
margin-top: 20rpx;
font-weight: 600;
.choose-label-title {
margin-bottom: 30rpx;
font-size: 30rpx;
text {
font-weight: normal;
color: #bac0d7;
display: block;
font-size: 26rpx;
line-height: 54rpx;
}
}
.choose-label-price {
color: #fd7164;
font-size: 34rpx;
text {
font-size: 26rpx;
}
}
}
}
}
.chooseBuy {
position: fixed;
width: 100%;
height: 110rpx;
left: 0;
bottom: 0;
display: flex;
background-color: #FFFFFF;
padding: 30rpx;
box-sizing: border-box;
.chooseBuy-btn {
position: absolute;
right: 20rpx;
top: 26rpx;
background-color: #f24b44;
color: #FFFFFF;
height: 62rpx;
line-height: 60rpx;
margin: 0;
font-size: 28rpx;
padding: 0 35rpx;
}
.chooseBuy-name {
font-size: 32rpx;
line-height: 48rpx;
}
.chooseBuy-price {
font-size: 28rpx;
line-height: 50rpx;
color: #777b85;
text {
color: #f14646;
padding-left: 20rpx;
}
}
}
.chooseForm {
background-color: #FFFFFF;
margin: 0 15rpx;
border-radius: 10rpx;
.site-input {
font-size: 30rpx;
padding: 0 30rpx 0 220rpx;
box-sizing: border-box;
position: relative;
line-height: 100rpx;
min-height: 100rpx;
&::before {
position: absolute;
bottom: 0;
width: 100%;
left: 0rpx;
right: 0;
height: 1rpx;
content: "";
background: #e4e6f2;
}
&:last-child::before {
display: none;
}
label {
position: absolute;
left: 30rpx;
top: 0;
}
input {
font-size: 30rpx;
height: 110rpx;
}
image {
width: 38rpx;
height: 38rpx;
position: absolute;
right: 20rpx;
top: 32rpx;
}
}
}
</style>

View File

@@ -0,0 +1,546 @@
<template>
<view>
<!-- 卡券详情 -->
<view class="details">
<view class="detailsTop">
<view class="detailsTop-name">
{{ details.name }}
</view>
<view class="detailsTop-time">
有效期 {{ details.startTime }} - {{ details.endTime }}
</view>
</view>
<view class="detailsCotent">
<view class="source">活动来源 {{ details.activity_name }}</view>
<view class="detailsBar">
<view class="detailsCode-text">劵码</view>
<image :src="barcode" mode="widthFix"></image>
</view>
<view class="detailsCode-text">
{{ details.code }}
</view>
<view class="detailsCode">
<image :src="qrcode"></image>
<view class="detailsCode-text">
<text>请出示以上券码给网点工作人员</text>
</view>
</view>
<!-- 门店定位 -->
<view class="detailsStore">
<view class="detailsStore-top">
<view class="detailsStore-title">
适用门店
</view>
<navigator class="detailsStore-row" hover-class="none" :url="'/pages/store/index?id=' + details.id + '&type=campus'" v-if="longitude != 0 && latitude != 0">
查看所有
<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>
</view>
</view>
<!-- 使用须知 -->
<view class="detailsText">
<view class="detailsText-title">
使用须知
</view>
<view class="detailsText-tips">
<rich-text :nodes="remark"></rich-text>
</view>
</view>
<!-- 内容介绍 -->
<view class="detailsText">
<view class="detailsText-title">
内容介绍
</view>
<view class="detailsText-tips" v-if="content != null">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
<!-- 底部 -->
<view class="detailsBottom">
<image src="/static/img/campus_details_back.png" mode="aspectFill"></image>
<view class="detailsBottom-cont">
<view class="detailsBottom-title">
抽奖活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>
</template>
<script>
import { qrcode, barcode, couponinfo, merchantCard } from '@/apis/interfaces/campus'
export default {
data() {
return {
id : 0, //优惠券id
longitude : 0, //经度
latitude : 0, //纬度
details : '', //优惠券信息
stores : [], //商家列表
content : '', //内容介绍
remark : '', //使用须知
qrcode : '', //二维码
barcode : '', //条形码
merchantcardinfo:'' //商家券信息
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 优惠券id
this.id = options.id
// 获取二维码
qrcode(options.id).then(res=>{
this.qrcode = res.qrcode
})
// 获取条形码
barcode(options.id).then(res=>{
this.barcode = res.barcode
})
},
onShow () {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
// 查看定位信息
this.getCity();
},
methods: {
// 详情信息
detailsInfo() {
couponinfo({
coupon_id: this.id,
user_lng: this.longitude,
user_lat: this.latitude
}).then(res=>{
console.log(res)
let stores = res.stores
stores.map(res=>{
let distance = res.distance
if(res.distance > 1000){
distance = (distance / 1000) + "km"
}else{
distance = distance + "m"
}
res.km = distance
})
this.details = res.info
this.stores = stores
this.remark = res.info.right.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.content = res.info.right.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
//获取商家券信息
if(res.info.card_type=='merchant_card'){
this.getMerchantCardInfo()
}
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/unicom/signin'
});
}
}
});
}
})
},
// 商家券信息
getMerchantCardInfo(){
merchantCard(this.id).then(res=>{
this.merchantcardinfo = res
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/unicom/signin'
});
}
}
});
}
})
},
// 拨打电话
tel(e) {
let tel = e.currentTarget.dataset.tel
uni.showActionSheet({
itemList : ['呼叫商家电话'],
success : res =>{
if(res.tapIndex==0){
uni.makePhoneCall({
phoneNumber: tel
})
}
}
})
},
// 查看门店详情页
detailsTap(e) {
let store_id = e.currentTarget.dataset.id,
user_lng = this.longitude,
user_lat = this.latitude
uni.navigateTo({
url: '/pages/store/details?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat + '&type=campus'
})
},
// 获取位置
getCity(){
uni.getLocation({
success: res => {
this.latitude   = res.latitude,
this.longitude  = res.longitude
},
complete: (err) => {
// 获取详情信息
this.detailsInfo();
}
})
}
}
}
</script>
<style>
page {
background-color: #e83241;
padding: 20rpx;
box-sizing: border-box;
}
/* 卡券详情 */
.details {
background: #ffffff;
margin: 20rpx 20rpx 0;
overflow: hidden;
width: calc(100% - 40rpx);
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
position: relative;
border-radius: 0 0 20rpx 20rpx;
border-bottom: 240rpx solid transparent;
}
.details::after,
.details::before {
position: absolute;
background: #e83241;
content: '';
top: -50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.details::after {
left: -50rpx;
}
.details::before {
right: -50rpx;
}
.detailsCotent {
padding: 40rpx;
box-sizing: border-box;
}
.detailsTop {
border-bottom: 2rpx dashed #c8c8c8;
padding: 40rpx 0;
text-align: center;
background-color: #f5f5f5;
}
.detailsTop-name {
font-size: 38rpx;
font-weight: 600;
margin-bottom: 20rpx;
padding: 0 60rpx;
box-sizing: border-box;
}
.detailsTop-time {
color: #7e7e7e;
font-size: 26rpx;
}
.detailsCode {
text-align: center;
padding: 0 0 20rpx;
margin: 40rpx 0 30rpx;
}
.detailsCode image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
.detailsCode-text, .detailsStore-row {
color: #949494;
font-size: 28rpx;
}
.detailsCode-text {
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #000;
}
.detailsCode-text text {
color: #999;
font-weight: normal;
font-size: 26rpx;
}
.detailsStore {
border-top: 2rpx #c8c8c8 solid;
padding-top: 40rpx;
}
.detailsStore-top, .detailsStore-row {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
}
.detailsStore-title {
flex: 1;
font-weight: 600;
}
.detailsStore-row image {
width: 26rpx;
height: 26rpx;
margin: 3rpx 0 0 6rpx;
}
.detailsStore-list {
position: relative;
margin-bottom: 40rpx;
}
.detailsStore-list:last-child {
margin-bottom: 0;
}
.detailsStore-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.detailsStore-cont {
position: absolute;
left: 130rpx;
top: 0;
width: calc(100% - 130rpx);
display: flex;
}
.detailsStore-left {
width: calc(100% - 90rpx);
margin-right: 30rpx;
}
.detailsStore-tel {
width: 60rpx;
height: 60rpx;
margin-top: 25rpx;
}
.detailsStore-place {
font-size: 24rpx;
line-height: 40rpx;
color: #5a5a5a;
display: flex;
}
.detailsStore-place text {
flex: 1;
display: inline-block;
font-size: 28rpx;
margin-right: 20rpx;
}
.detailsStore-name {
margin-bottom: 20rpx;
}
.detailsText {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
border-top: 2rpx solid #ececec;
}
.detailsText-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsText-tips {
font-size: 26rpx;
line-height: 50rpx;
color: #555557;
padding-bottom: 20rpx;
}
.detailsCode-join {
color: #ee8e44;
font-size: 24rpx;
border-radius: 50rpx;
border: 2rpx solid #ee8e44;
padding: 10rpx 20rpx;
display: inline-block;
margin-top: 30rpx;
}
.detailsCode-join.active {
border: 2rpx solid #999;
color: #999;
}
.source{
margin: 30rpx 0;
font-size: 28rpx;
}
.location {
background: white;
width: 100%;
text-align: center;
margin: 60rpx 0 0;
}
.location text {
font-size: 28rpx;
display: block;
line-height: 46rpx;
color: #999;
}
.location-btn[size="mini"] {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 66rpx;
margin-top: 30rpx;
}
.location-img {
width: 150rpx;
height: 120rpx;
margin-bottom: 20rpx;
}
.detailsBar {
text-align: center;
padding: 0 50rpx;
box-sizing: border-box;
margin-top: 60rpx;
margin-bottom: 40rpx;
}
.detailsBar image {
width: 100%;
}
.detailsBar .detailsCode-text {
margin-bottom: 10px;
color: #000;
}
.detailsBottom {
position: fixed;
width: 100%;
height: 220rpx;
left: 0;
bottom: 0;
z-index: 9;
}
.detailsBottom image {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.detailsBottom-cont {
z-index: 10;
position: absolute;
left: 0;
top: 70rpx;
width: 100%;
text-align: center;
color: #9a9a9a;
font-size: 26rpx;
}
.detailsBottom-title {
font-weight: 600;
margin-bottom: 20rpx;
font-size: 30rpx;
}
</style>

View File

@@ -0,0 +1,603 @@
<template>
<view class="content">
<!-- 抽奖 -->
<image class="luckBack" src="https://card.ysd-bs.com/storage/materials/2022/05/12/luck_back.png"></image>
<view class="luck">
<image class="luckTitle" src="https://card.ysd-bs.com/storage/materials/2022/09/23/drawTitle.png" mode="widthFix"></image>
<view class="drawContent">
<image class="drawContent-back" src="https://card.ysd-bs.com/storage/materials/2022/05/16/ly-plate-c.png" mode="widthFix"></image>
<view class="drawContent-number" v-if="isUser">抽奖数<text>{{number >= 0 ? number : '0'}}</text></view>
<image class="drawContent-award" :animation="animationData" bindtransitionend='animationend' :src="picture" mode="widthFix"></image>
<image class="drawContent-arrow" @click="onExtracting" src="https://card.ysd-bs.com/storage/materials/2022/05/12/playbtn.png" mode="widthFix"></image>
<image class="drawFooter drawFooter-right" src="https://card.ysd-bs.com/storage/materials/2022/05/12/dial_rigntImg.png" mode="widthFix"></image>
<image class="drawFooter drawFooter-left" src="https://card.ysd-bs.com/storage/materials/2022/05/12/dial_leftImg.png" mode="widthFix"></image>
</view>
<view class="roll">
<view class="roll-title">
- 参与抽奖用户 -
</view>
<swiper class="roll-list" interval="3000" autoplay circular vertical bindchange="swiperChange">
<swiper-item class="roll-item" catchtouchmove="stopTouchMove" v-for="(item, index) in logsArr" :key="index">
<view class="roll-name" v-if="item.user">
{{item.user.nickname}}
</view>
<view class="roll-tel" v-if="item.user">
{{item.user.username}}
</view>
<view class="roll-time">
{{item.created_at}}
</view>
</swiper-item>
</swiper>
</view>
<navigator v-if="isUser" hover-class="none" :url="'logs?id=' + exchageId" class="dial-record">抽奖记录</navigator>
<view class="dial-btns">
<view @click="userNav('order?type=paid')" class="dial-btns-go">
我的订单
</view>
<view @click="userNav('myCoupon')" class="dial-btns-go dial-btns-order">
我的优惠券
</view>
</view>
<view class="setupLabel" @click="delStorage" v-if="isUser">
<view class="setupLabel-name">
切换用户
</view>
</view>
</view>
<!-- 弹出 -->
<view class="popBack" v-if="pointShow"></view>
<view class="popCont" v-if="pointShow">
<view class="popTips">
<image class="luckTips" src="https://card.ysd-bs.com/storage/materials/2022/05/12/luckTips.png" mode="widthFix"></image>
<view class="Tips-title">
恭喜中奖
</view>
<view class="Tips-text">
获得{{prize}}
</view>
<view class="Tips-btn">
<image class="Tips-btn-image" src="https://card.ysd-bs.com/storage/materials/2022/05/12/luckBtn.png"></image>
<view v-if="value == 2" class="Tips-btn-text" @click="exchange(luckId)">去兑换</view>
<view v-else class="Tips-btn-text" @click="useGp(luckId)">去使用</view>
</view>
<view class="Tips-out">~温馨提示请您尽快使用哦~</view>
</view>
<view class="luckClose">
<image src="/static/img/luckClose.png" mode="widthFix" @click="luckClosePop"></image>
</view>
</view>
</view>
</template>
<script>
import { index, result } from '@/apis/interfaces/draw'
export default {
data() {
return {
isUser : false, // 用户是否登录
number : '', //抽奖次数
logsArr : '', //获奖列表
luckId : '', //抽奖列表id
pointShow : false, //抽奖弹出
prize : '', //获得奖项标题
value : '', //获得奖项类型
animationData : {}, //旋转动画
picture : '', //抽奖转盘图片
isState : false, //抽奖状态
exchageId : '', //抽奖id
backGround : '',
itemArr : []
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 初始化动画信息
const animation = uni.createAnimation({
duration : 2000,
timingFunction : 'ease-in-out'
})
this.animation = animation
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
if(uni.getStorageSync("token")) {
this.isUser = true
// 获取抽奖默认信息(抽奖次数)
}
this.drawShow();
},
methods: {
// 抽奖默认信息(抽奖次数)
drawShow(){
index().then(res=>{
this.countLengtht= res.lottery.items_count
this.number = res.lottery.number
this.background = res.lottery.background
this.picture = res.lottery.picture
this.exchageId = res.lottery.exchage_id
this.itemArr = res.lottery.items
this.logsArr = res.logs
})
},
// 抽奖
onExtracting(){
if(uni.getStorageSync("token")) {
result(this.exchageId).then(res=>{
let runNum = 3 // 旋转圈数
// 检查抽奖状态
if(this.isState) return
if(this.number <= 0){
uni.showToast({
title: '今日抽奖次数已用完,请明天再来吧~',
icon : 'none'
})
return
}
// 更新抽奖状态
this.isState = true
this.prize = res.log.exchange_item.title
this.value = res.log.exchange_item.type.value
this.luckId = res.log.exchage_log_id
//旋转角度
this.runDeg = this.runDeg || 0;
this.runDeg = this.runDeg + (360 - this.runDeg % 360) + (360 * runNum - (res.log.exchange_item.order - 1) * Math.round(360 / this.countLengtht))
// 动画
this.animation.rotate(this.runDeg).step()
this.animationData = this.animation.export()
// 提示用户中奖信息
setTimeout(()=>{
this.isState = false
this.pointShow = true
},3000)
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/draw/signin'
})
},
// 动画结束弹出
animationend(){
setTimeout(()=>{
this.pointShow = true
},1000)
},
// 关闭弹出
luckClosePop() {
uni.showModal({
title : '提示',
content : '是否放弃此权益',
success : res=> {
if (res.confirm) {
this.pointShow = false
}
// 获取抽奖默认信息(抽奖次数)
this.drawShow();
}
})
},
// 兑换乐心三件套
exchange(id) {
uni.navigateTo({
url: "choose?id=" + id
})
this.pointShow = false
},
// 使用权益券
useGp(id){
uni.navigateTo({
url: "right?luck_id=" + id
})
this.pointShow = false
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url
if(uni.getStorageSync("token")) {
uni.navigateTo({
url: pageUrl
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/draw/signin'
})
},
// 退出登录
delStorage() {
uni.clearStorage()
uni.navigateTo({
url:'/pages/draw/signin'
})
},
// 禁止滚动
stopTouchMove() {
return false
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #e4353a;
}
.luckBack {
position: fixed;
width: 100vw;
height: 100%;
left: 0;
top: 0;
}
.luck {
position: fixed;
width: 100%;
overflow: hidden;
height: 100%;
z-index: 9;
left: 0;
top: 0;
padding: 80rpx 40rpx 20rpx;
box-sizing: border-box;
overflow-y: scroll;
text-align: center;
}
.luckTitle {
width: 90%;
}
.drawFooter{
position: absolute;
z-index: 9;
}
.drawFooter-right {
width: 48%;
bottom: -70rpx;
right: -16%;
}
.drawFooter-left {
width: 60%;
bottom: -30rpx;
left: -18%;
}
/* 转盘 */
.drawContent{
margin: 60rpx auto 40rpx;
width: 100%;
padding-top: 100%;
position: relative;
}
.drawContent-arrow,
.drawContent-back,
.drawContent-award{
position: absolute;
}
.drawContent-back{
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.drawContent-award{
width: 76%;
height: 76%;
top: 5.5%;
left: 13.5%;
}
.drawContent-arrow{
width: 26%;
height: 26%;
top: 28%;
left: 39%;
}
.drawContent-number {
bottom: 38rpx;
color: #ffffff;
left: 0;
width: 100%;
position: absolute;
text-align: center;
padding-left: 20rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.drawContent-number text {
font-weight: 600;
padding: 0 5rpx;
}
.dial-btns {
padding-bottom: 40rpx;
display: flex;
.dial-btns-go {
flex: 2;
text-align: center;
box-sizing: border-box;
background-color: #ffeace;
border: 2rpx solid transparent;
color: #5a0000;
margin-top: 40rpx;
border-radius: 50rpx;
height: 80rpx;
line-height: 80rpx;
margin: 50rpx 15rpx 0;
}
.dial-btns-order {
background-color: #f3524a;
color: #ffeace;
border-color: #ffeace;
}
}
/* 弹出 */
.popBack {
background-color: rgba(0, 0, 0, .7);
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 99;
}
.popCont {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
left: 0;
right: 0;
top: 0;
bottom: 0;
position: fixed;
width: 100%;
height: 100%;
z-index: 100;
padding: 140rpx 100rpx 0;
box-sizing: border-box;
}
.popTips{
color: #ffffff;
width: 100%;
padding: 140rpx 30rpx 30rpx;
box-sizing: border-box;
background-color: #de3935;
border-radius: 20rpx;
text-align: center;
color: #ffe3ba;
position: relative;
}
.luckTips {
position: absolute;
top: -120rpx;
z-index: 101;
width: 60%;
left: 25%;
}
.Tips-title {
font-size: 60rpx;
margin-bottom: 60rpx;
}
.Tips-text {
font-size: 34rpx;
}
.Tips-btn {
margin: 100rpx 0 20rpx;
position: relative;
padding-top: 14%;
}
.Tips-btn-image {
position: absolute;
width: 70%;
height: 100%;
left: 15%;
top: 0;
}
.Tips-btn-text {
font-size: 30rpx;
text-align: center;
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
color: #c35b34;
display: -webkit-box;
-webkit-box-orient: vertical;
font-weight: 600;
-webkit-box-pack: center;
}
.Tips-out {
font-size: 28rpx;
line-height: 90rpx;
}
.luckClose {
width: 100%;
text-align: center;
margin-top: 40rpx;
}
.luckClose image {
width: 64rpx;
opacity: .5;
}
/* 抽奖规则 */
.rulesBack {
background-color: rgba(0, 0, 0, .7);
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 99;
display: none;
}
.rulesCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
left: 0;
right: 0;
top: 25vh;
bottom: 0;
position: fixed;
width: 100%;
height: 50vh;
z-index: 100;
display: none;
}
.rulesBack.active {
display: block;
}
.rulesCont.active {
display: -webkit-box;
}
.luckRules {
position: absolute;
left: 10%;
top: 0;
width: 80%;
box-sizing: border-box;
z-index: 100;
}
.textRules {
position: absolute;
left: 10%;
top: 0;
width: 80%;
z-index: 101;
height: 100%;
padding: 60rpx 80rpx;
color: #ffffff;
line-height: 58rpx;
box-sizing: border-box;
}
.rulesClose-title {
width: 60%;
display: block;
margin: 20rpx auto 40rpx;
}
.textRules-text {
height: 70%;
overflow: hidden;
overflow-y: scroll;
}
.rulesClose {
position: absolute;
z-index: 102;
right: 50rpx;
top: 60rpx;
width: 54rpx;
opacity: .8;
}
.roll {
height: 160rpx;
overflow: hidden;
background-color: #f5675a;
border: 4rpx solid #ffeace;
border-radius: 20rpx;
padding: 20rpx;
box-sizing: border-box;
margin: 60rpx 15rpx 0;
width: calc(100% - 30rpx);
.roll-title {
color: #ffeace;
font-size: 34rpx;
}
.roll-list {
height: 90rpx;
}
.roll-item {
height: 90rpx;
display: flex;
line-height: 90rpx;
color: #fff0dd;
font-size: 28rpx;
view {
flex: 3;
}
.roll-name {
text-align: left;
}
.roll-time {
text-align: right;
}
}
}
// 中间记录
.dial-record {
position: absolute;
top: 20%;
right: 0;
background-color: rgba($color: #ffdba2, $alpha: .9);
border-radius: 30rpx 0 0 30rpx;
line-height: 58rpx;
font-size: 30rpx;
color: #b80501;
padding: 0 15rpx 0 20rpx;
}
.setupLabel {
width: 100%;
text-align: center;
line-height: 90rpx;
color: #FFFFFF;
opacity: .8;
}
</style>

View File

@@ -0,0 +1,175 @@
<template>
<view class="content">
<!-- 抽奖tab -->
<view class="recordTab">
<view class="recordTab-label" :class="{active : stateType == item.type}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-index="(index)" :data-state="(item.type)">
{{ item.title }}
</view>
</view>
<view class="record" v-if="awardsArr.length > 0">
<view class="top">
<text>抽奖结果</text>
<text>抽奖状态</text>
<text>抽奖时间</text>
<text>操作</text>
</view>
<view class="list">
<view class="item" v-for="(item, index) in awardsArr" :key="index">
<text class="itemText" v-if="item.exchange_item">{{item.exchange_item.title}}</text>
<text class="itemText" v-if="item.status" :class="{red : item.status.value == 1}">{{item.status.text}}</text>
<text class="itemText">{{item.created_at}}</text>
<text class="itemText" v-if="stateType == 'right'">
<view v-if="item.status.value == 1" class="itemText-go itemText-active">已使用</view>
<navigator v-else class="itemText-go" hover-class="none" :url="'right?luck_id=' + item.exchage_log_id">去使用</navigator>
</text>
<text class="itemText" v-else>
<view v-if="item.status.value == 1" class="itemText-go itemText-active">已领取</view>
<navigator v-else class="itemText-go" hover-class="none" :url="'choose?id=' + item.exchage_log_id">去领取</navigator>
</text>
</view>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/img/staff_null.png"></image>
<view>暂无抽奖记录</view>
</view>
</view>
</template>
<script>
import { awards } from '@/apis/interfaces/draw'
export default {
data() {
return {
//抽奖Tab列表
couponLabel : [
{ title : "权益", type: 'right' },
{ title : "商品", type: 'goods' }
],
stateType : 'right', //订单状态
awardsArr : [] //记录列表
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.couponId = options.id
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
// 获取记录列表
this.awardInfo();
},
methods: {
// 记录列表
awardInfo(id){
awards(this.couponId, {
type: this.stateType
}).then(res=>{
this.awardsArr = res
})
},
// tab选择
orderTab(e){
this.stateType = e.currentTarget.dataset.state
// 获取记录列表
this.awardInfo();
}
}
}
</script>
<style lang="scss" scoped>
.recordTab {
position: fixed;
width: 100%;
height: 100rpx;
border-bottom: 2rpx solid #ebebeb;
z-index: 99;
left: 0;
top: 0;
display: flex;
padding: 20rpx 0;
box-sizing: border-box;
background-color: #FFFFFF;
.recordTab-label {
flex: 2;
text-align: center;
position: relative;
&::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
background-color: #FFFFFF;
width: 40rpx;
height: 6rpx;
border-radius: 50rpx;
}
&.active {
color: #eb4747;
}
&.active::after {
background-color: #eb4747;
}
}
}
.record {
width: 100%;
margin-top: 100rpx;
.top {
color: #999999;
background-color: #FFFFFF;
line-height: 90rpx;
font-size: 28rpx;
overflow: hidden;
text {
display: inline-block;
width: 25%;
text-align: center;
}
}
.list {
.item {
background-color: #FFFFFF;
line-height: 90rpx;
overflow: hidden;
border-top: 2rpx solid #ebebeb;
font-size: 26rpx;
.itemText {
display: inline-block;
width: 25%;
text-align: center;
&:nth-child(2) {
color: green;
}
&:nth-child(2).active {
color: #eb4747;
}
&.red {
color: red;
}
.itemText-go {
margin: 0 auto;
background-color: #eb4747;
height: 44rpx;
line-height: 44rpx;
width: 60%;
text-align: center;
color: #FFFFFF;
border-radius: 10rpx;
font-size: 24rpx;
&.itemText-active {
background-color: #d3d3d3;
}
}
}
}
}

View File

@@ -0,0 +1,226 @@
<template>
<view class="content">
<!-- 卡券tab -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : stateType == item.used}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-state="(item.used)">
{{ item.title }}
<!-- <text v-if="item.used == 0">({{couponLabel.length}})</text>
<text v-else-if="item.used == 1">({{couponLabel.length}})</text>
<text v-else>({{couponLabel.length}})</text> -->
</view>
</view>
<!-- 卡券列表 -->
<view class="coupon" v-if="couponsArr.length > 0">
<view hover-class="none" class="couponList" v-for="(item, index) in couponsArr" :key="index">
<!-- 优惠券 -->
<image class="couponList-left" v-if="item.status == 0" src="/static/img/draw_coupon.png" mode="widthFix"></image>
<image class="couponList-left" v-else src="/static/img/draw_coupon_active.png" mode="widthFix"></image>
<view class="couponList-center">
<view class="nowrap couponList-title">{{item.name}}</view>
<view class="nowrap couponList-used">活动来源 {{item.activity_name}}</view>
<view class="couponList-time">{{item.startTime}} {{item.endTime}}</view>
</view>
<navigator hover-class="none" :url="'couponDetails?id=' + item.id" class="couponList-right" v-if="item.status == 0">
去使用
</navigator>
<view class="couponList-right couponList-right-active" v-else>
{{item.status == 1 ? '已使用' : '已过期'}}
</view>
<!-- v-if="item.status == 1" -->
<!-- <image src="/static/img/coupon_tips_00.png" class="coupoTips"></image> -->
<!-- <image v-if="item.status == 2" src="/static/img/coupon_tips_01.png" class="coupoTips"></image> -->
</view>
<view class="pagesLoding" v-if="lodingStats">
<block v-if="page.has_more">
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block v-else>
没有更多了~
</block>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { coupons } from '@/apis/interfaces/draw'
export default {
data() {
return {
couponsArr : [], //优惠券列表
count : '', //优惠券-张数
//优惠券Tab列表
couponLabel : [
{ title : "未使用", used: 0 },
{ title : "已使用", used: 1 },
{ title : "已过期", used: 2 }
],
stateType : '0', //卡券状态
type : '', //卡券来源
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-抽奖活动
getApp().globalData.envType = 'drawEnv'
// 获取优惠券列表
this.couponInfo();
},
methods: {
// 订单列表
couponInfo(page){
coupons({
status: this.stateType,
page : page || ''
}).then(res=>{
let listArr = this.couponsArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.couponsArr = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/draw/signin'
});
}
}
});
}
})
},
// tab选择
orderTab(e){
this.stateType = e.currentTarget.dataset.state
// 获取优惠券列表
this.couponInfo();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取优惠券列表
this.couponInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.couponInfo(pageNumber)
}
}
}
}
</script>
<style lang="scss" scoped>
.couponTab{
position: fixed;
width: 100%;
height: 90rpx;
line-height: 90rpx;
z-index: 99;
left: 0;
top: 0;
display: flex;
box-sizing: border-box;
background-color: #FFFFFF;
.couponTab-label {
flex: 3;
text-align: center;
text {
display: block;
font-size: 28rpx;
color: #999999;
line-height: 54rpx;
}
&.active {
color: #eb4747;
}
&.active text {
color: #ff8b8b;
}
}
}
.coupon {
width: 100%;
margin-top: 90rpx;
padding: 30rpx;
box-sizing: border-box;
.couponList {
background-color: #FFFFFF;
height: 190rpx;
border-radius: 20rpx;
margin-bottom: 30rpx;
padding: 30rpx;
box-sizing: border-box;
position: relative;
.couponList-left {
width: 80rpx;
}
.couponList-center {
position: absolute;
width: 100%;
left: 0;
top: 0;
padding: 30rpx 100rpx 0 140rpx;
box-sizing: border-box;
color: #999999;
font-size: 28rpx;
.couponList-title {
color: #000000;
font-size: 30rpx;
font-weight: 600;
width: 70%;
}
.couponList-used {
line-height: 54rpx;
}
}
.couponList-right {
position: absolute;
width: 120rpx;
line-height: 50rpx;
text-align: center;
right: 25rpx;
font-size: 28rpx;
top: 25rpx;
color: #eb4747;
border: 2rpx solid #eb4747;
border-radius: 50rpx;
&.couponList-right-active {
border-color: #ddd;
color: #a9a9a9;
}
}
}
}
</style>

View File

@@ -0,0 +1,239 @@
<template>
<view class="content">
<!-- 订单tab -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : stateType == item.type}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-state="(item.type)">
{{ item.title }}
</view>
</view>
<!-- 订单列表 -->
<view class="order" v-if="ordersArr.length > 0">
<view class="orderList" v-for="(item, index) in ordersArr" :key="index">
<view class="orderList-title">
<image class="orderList-icon" src="/static/img/draw_order.png" mode="widthFix"></image>订单号{{item.orderid}}
</view>
<view class="orderList-label">
<view class="orderList-item">
<text>产品名称</text>{{item.award.title}}
</view>
<view class="orderList-item">
<text>产品价格</text>
{{item.amount != 0 ? '¥' + item.amount : '免费兑换'}}
</view>
</view>
<view class="orderList-tool">
<view class="orderList-time">
{{item.created_at}}
</view>
<!-- <navigator hover-class="none" url="orderDetails" class="orderList-btn">
</navigator> -->
</view>
</view>
<view class="pagesLoding" v-if="lodingStats">
<block v-if="page.has_more">
<image class="pagesLodingIcon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block v-else>
没有更多了~
</block>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { orders } from '@/apis/interfaces/draw'
export default {
data() {
return {
ordersArr : [], //订单列表
//订单Tab列表
couponLabel : [
{ title : "已支付", type: 'paid' },
{ title : "未支付", type: 'unpay' }
],
stateType : 'paid', //订单状态
page : 1, //分页
lodingStats : false //加载状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
console.log(options)
this.stateType = options.type
},
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
// 获取订单列表
this.orderInfo();
},
methods: {
// 订单列表
orderInfo(page){
orders({
type: this.stateType,
page: page || ''
}).then(res=>{
console.log(res.data)
let listArr = this.ordersArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.ordersArr = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/draw/signin'
});
}
}
});
}
})
},
// tab选择
orderTab(e){
this.stateType = e.currentTarget.dataset.state
// 获取订单列表
this.orderInfo();
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取订单列表
this.orderInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.orderInfo(pageNumber)
}
}
}
}
</script>
<style lang="scss">
.couponTab{
position: fixed;
width: 100%;
height: 100rpx;
z-index: 99;
left: 0;
top: 0;
display: flex;
padding: 20rpx 0;
box-sizing: border-box;
background-color: #FFFFFF;
.couponTab-label {
flex: 4;
text-align: center;
position: relative;
&::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
background-color: #FFFFFF;
width: 40rpx;
height: 6rpx;
border-radius: 50rpx;
}
&.active {
color: #eb4747;
}
&.active::after {
background-color: #eb4747;
}
}
}
.order {
width: 100%;
margin-top: 100rpx;
padding: 30rpx;
box-sizing: border-box;
.orderList {
background-color: #FFFFFF;
border-radius: 20rpx;
margin-bottom: 30rpx;
.orderList-title {
padding: 0 30rpx;
box-sizing: border-box;
line-height: 90rpx;
display: flex;
font-size: 30rpx;
border-bottom: 2rpx solid #eeeeee;
.orderList-icon {
width: 40rpx;
height: 40rpx;
margin: 25rpx 20rpx 0 0;
}
}
.orderList-label {
padding: 10rpx 30rpx;
border-bottom: 2rpx solid #eeeeee;
box-sizing: border-box;
font-size: 28rpx;
.orderList-item {
display: flex;
line-height: 60rpx;
text {
display: block;
flex: 1;
color: #666666;
}
}
}
.orderList-tool {
padding: 0 30rpx;
line-height: 90rpx;
box-sizing: border-box;
display: flex;
font-size: 28rpx;
color: #999999;
.orderList-time {
flex: 1;
}
.orderList-btn {
font-size: 28rpx;
color: #e31828;
border: 2rpx solid #e31828;
display: inline-block;
height: 54rpx;
line-height: 54rpx;
margin-top: 16rpx;
border-radius: 40rpx;
padding: 0 25rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,229 @@
<template>
<view class="content">
<view class="orderData">
<view class="While">
<view class="orderData-cont-label">
<image class="orderData-cont-img" src="/static/icon/orderIcon_01.png" mode="aspectFill"></image>
<view class="orderData-cont-text">
<view class="orderData-cont-name">订单编号</view>
<view class="orderData-cont-copy">
<text class="nowrap">57843657846357834</text>
<view bindtap="copyUrl">复制</view>
</view>
</view>
</view>
<view class="orderData-cont-label">
<image class="orderData-cont-img" src="/static/icon/orderIcon_00.png" mode="aspectFill"></image>
<view class="orderData-cont-text">
<view class="orderData-cont-name">慢慢悠 <text>1800000000</text></view>
<view class="orderData-cont-copy">
汗水里156高
</view>
</view>
</view>
</view>
<view class="While reserveCont">
<view class="reserveCont-title">订单信息</view>
<view class="reserve-label">
<view class="reserve-name">商品</view>
<view class="reserve-text">乐心血压仪</view>
</view>
<view class="reserve-label">
<view class="reserve-name">金额</view>
<view class="reserve-text reserve-red">399</view>
</view>
<view class="reserve-label">
<view class="reserve-name">交易时间</view>
<view class="reserve-text">2022-09-23 15:00</view>
</view>
<view class="reserve-label">
<view class="reserve-name">运费金额</view>
<view class="reserve-text">免邮</view>
</view>
<view class="reserve-label">
<view class="reserve-name">交易状态</view>
<view class="reserve-text green">待发货</view>
</view>
</view>
<view class="While reserveCont">
<view class="reserveCont-title">物流信息</view>
<view class="reserve-label">
<view class="reserve-name">物流公司</view>
<view class="reserve-text">顺丰速递</view>
</view>
<view class="reserve-label">
<view class="reserve-name">收货姓名</view>
<view class="reserve-text green">慢悠悠</view>
</view>
<view class="reserve-label">
<view class="reserve-name">收货电话</view>
<view class="reserve-text green">15000000000</view>
</view>
<view class="reserve-label">
<view class="reserve-name">物流单号</view>
<view class="reserve-text">6546546546546<view class="reserve-copy" bindtap="copyUrl">复制</view>
</view>
</view>
</view>
</view>
<view class="order-data-footer">
<navigator hover-class="none" class="order-btn" open-type="navigateBack">返回订单</navigator>
<view class="order-btn" bindtap="signClick">签收订单</view>
</view>
</view>
</template>
<script>
import { } from '@/apis/interfaces/draw'
export default {
data() {
return {
}
},
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
}
}
</script>
<style lang="scss">
page {
padding: 30rpx;
box-sizing: border-box;
}
.orderData {
border-bottom: 70rpx transparent solid;
}
.While {
border-radius: 10rpx;
margin-bottom: 30rpx;
background-color: #FFFFFF;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .05);
}
/* 订单 */
.orderData-cont-label {
padding: 40rpx 30rpx;
display: flex;
box-sizing: border-box;
border-bottom: #f2f2f2 2rpx solid;
.orderData-cont-img {
width: 48rpx;
height: 48rpx;
vertical-align: middle;
}
.orderData-cont-text {
width: calc(100% - 68rpx);
margin-left: 20rpx;
box-sizing: border-box;
}
.orderData-cont-name {
margin-bottom: 10rpx;
}
.orderData-cont-name text {
color: #999;
padding-left: 20rpx;
}
.orderData-cont-copy {
display: flex;
font-size: 28rpx;
color: #999;
}
.orderData-cont-copy text {
flex: 1;
display: inline-block;
margin-right: 20rpx;
}
.orderData-cont-copy view {
color: #e31828;
}
}
/* 规格 */
.reserveCont-title {
font-weight: 600;
padding: 30rpx;
}
.reserve-label {
display: flex;
padding: 0 30rpx 30rpx;
box-sizing: border-box;
font-size: 28rpx;
}
.reserve-name {
flex: 1;
width: 200rpx;
margin-right: 20rpx;
color: #7e7e7e;
}
.reserve-text {
width: calc(100% - 240rpx);
text-align: right;
line-height: 50rpx;
}
.reserve-copy {
color: #fa8524;
border: #fa8524 2rpx solid;
display: inline-block;
height: 34rpx;
line-height: 34rpx;
font-size: 26rpx;
padding: 0 10rpx;
border-radius: 4rpx;
margin-left: 10rpx;
}
.reserve-red {
font-weight: 600;
color: #e31828;
}
/* 底部菜单 */
.order-data-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
border-top: solid 1rpx #f2f2f2;
padding-top: 17rpx;
padding-right: 30rpx;
padding-left: 30rpx;
height: 83rpx;
background: white;
display: flex;
flex-wrap: wrap;
flex-direction: row-reverse;
z-index: 9;
}
.order-btn {
margin-left: 20rpx;
height: 58rpx;
line-height: 58rpx;
box-sizing: border-box;
border: solid 1rpx #747788;
padding: 0 20rpx;
font-size: 26rpx;
border-radius: 10rpx;
margin-top: 5rpx;
}
</style>

View File

@@ -0,0 +1,190 @@
<template>
<view class="content">
<image class="drawTitle" src="@/static/img/draw-title.png" mode="widthFix"></image>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="11" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="inputs-code">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_04.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4" placeholder-style="color:#c9c9c9;"></input>
</view>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<button class="campus-form-btn" form-type="submit">设置新密码</button>
</form>
</view>
</view>
</template>
<script>
import { send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]||16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || ''
auth({
mobile: mobileNo,
code: code,
type: 'reset_password'
}).then(res => {
this.$store.commit('setToken', res.token)
uni.redirectTo({
url: '/pages/draw/setPassword'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f67b5a;
}
.drawTitle {
width: 100%;
}
.campus-cont {
padding: 10rpx 50rpx 60rpx;
box-sizing: border-box;
.campus-inputs {
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
height: 100rpx;
line-height: 100rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
.campus-form-icon {
width: 50rpx;
height: 50rpx;
margin: 25rpx 20rpx 0 0;
}
.campus-form-input {
width: calc(100% - 70rpx);
height: 100%;
line-height: 100rpx;
font-size: 32rpx;
}
}
.campus-form-btn {
background-color: #ffe455;
border-radius: 10rpx;
line-height: 100rpx;
font-size: 36rpx;
color: #6a4902;
margin-top: 20rpx;
box-shadow: 4rpx 4rpx 6rpx #c62024;
}
.login-box {
display: flex;
line-height: 90rpx;
padding: 0 10rpx;
box-sizing: border-box;
color: #FFFFFF;
font-size: 32rpx;
.login-box-flex {
flex: 1;
}
}
}
.inputs-code {
display: flex;
.campus-inputs {
flex: 1;
}
.campus-form-code {
background-color: #ffe455;
color: #735b1f;
font-size: 32rpx;
height: 100rpx;
line-height: 100rpx;
margin-left: 20rpx;
}
}
</style>

View File

@@ -0,0 +1,195 @@
<template>
<view class="content">
<image class="drawTitle" src="@/static/img/draw-title.png" mode="widthFix"></image>
<view class="campus-cont">
<form @submit="submitRegister">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="11" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="inputs-code">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_04.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4" placeholder-style="color:#c9c9c9;"></input>
</view>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="6" type="password" placeholder="请设置登录密码" name="password" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="6" type="password" placeholder="请确认登录密码" name="password_confirmation" placeholder-style="color:#c9c9c9;"></input>
</view>
<button class="campus-form-btn" form-type="submit">立即注册</button>
</form>
<view class="login-box">
<navigator class="login-box-flex" hover-class="none" url="signin">已有账号立即登录</navigator>
</view>
</view>
</view>
</template>
<script>
import { register, send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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({
title : err.message,
icon :'none',
duration: 2000
})
})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即注册
submitRegister(e){
let formValue = e.detail.value,
code = this.code || ''
register({
mobile : formValue.mobile,
password : formValue.password,
password_confirmation : formValue.password_confirmation,
code : code
}).then(res => {
this.$store.commit('setToken', res.token)
uni.reLaunch({
url: '/pages/draw/index'
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f67b5a;
}
.drawTitle {
width: 100%;
}
.campus-cont {
padding: 10rpx 50rpx 20rpx;
box-sizing: border-box;
.campus-inputs {
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
height: 100rpx;
line-height: 100rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
.campus-form-icon {
width: 50rpx;
height: 50rpx;
margin: 25rpx 20rpx 0 0;
}
.campus-form-input {
width: calc(100% - 70rpx);
height: 100%;
line-height: 100rpx;
font-size: 32rpx;
}
}
.campus-form-btn {
background-color: #ffe455;
border-radius: 10rpx;
line-height: 100rpx;
font-size: 36rpx;
color: #6a4902;
margin-top: 40rpx;
box-shadow: 4rpx 4rpx 6rpx #c62024;
}
.login-box {
line-height: 90rpx;
padding: 0 10rpx;
box-sizing: border-box;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
}
}
.inputs-code {
display: flex;
.campus-inputs {
flex: 1;
}
.campus-form-code {
background-color: #ffe455;
color: #735b1f;
font-size: 32rpx;
height: 100rpx;
line-height: 100rpx;
margin-left: 20rpx;
}
}
</style>

View File

@@ -0,0 +1,797 @@
<template>
<view>
<!-- 按钮 -->
<view class="newrightsBtn" @click="payment">
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">{{rightData.num}}件商品 </view>
<view>实付<text>{{rightData.total}}</text></view>
</view>
<button :disabled="disabled">立即购买</button>
</view>
<!-- 重要提示 -->
<view class="rightsPoint">
<view class="rightsPoint-cont">
<view class="rightsPoint-top">
<image src="/static/icon/Point_icon.png"></image>
<text>重要提示</text>
</view>
<view class="rightsPoint-text" :class="{active : pointMoreShow}">
<rich-text :nodes="notice.notification"></rich-text>
</view>
<view class="pointMore" bindtap="pointMoreTap">
<text>{{pointMoreShow == true ? '收起' : '展开'}}</text>
<image :src="pointMoreShow == true ? '/static/img/pointMore-up.png' : '/static/img/pointMore.png'">
</image>
</view>
</view>
</view>
<!-- 卡券 -->
<view style="padding-bottom: 220px">
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://card.ysd-bs.com/storage/materials/2022/05/13/class_back_02.png" mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont">
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" v-for="(item, index) in rightData.detail.logos" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
</scroll-view>
<view class="nowrap rightsCont-btn">
{{rightData.detail.title}}
</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="rightsNumber">
<image class="rightsGoods-img" :src="rightData.detail.goods_cover" mode="widthFix"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{ rightData.detail.title }}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number">{{ rightData.detail.amount }}</view>
<!-- <view class="rightsAdd">
<view class="rightsAdd-btn rightsAdd-remove" :class="{active : rightData.num != 1}" @click="goodsNumber('remove')">-</view>
<input class="rightsAdd-input" :data-num="rightData.num" :value="rightData.num" type="number" disabled=""></input>
<view class="rightsAdd-btn rightsAdd-plus" :class="{active : rightData.num != 1}">+</view>
</view> -->
</view>
</view>
</view>
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @click="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读使用须知内容介绍
</view>
<image class="noticeTitle-row" :class="{active : notice.noticeShow}" src="/static/icon/rightsArrow.png"></image>
</view>
<view class="noticeText" :class="{active : notice.noticeShow}">
<!-- <view class="noticeText-top">购买须知</view> -->
<view class="noticeText-cont" v-if="notice.remark">
<rich-text :nodes="notice.remark"></rich-text>
</view>
<!-- <view class="noticeText-top">内容介绍</view> -->
<view class="noticeText-cont" v-if="notice.content">
<rich-text :nodes="notice.content"></rich-text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { exchangesBuy } from '@/apis/interfaces/draw'
import { activityBuy } from '@/apis/interfaces/draw'
import { getAuthUrl, wpayH5Info, h5Pay } from '@/apis/interfaces/rights'
const jweixin = require('jweixin-module'); //获取微信支付
export default {
data() {
return {
tradeNo : '' , //订单
rightData: {
detail : '', // 权益内容
logId : '', // 权益id
addressSee : '', // 收货地址
num : 1, // 购买数量
moreAmount : '', // 产品总金额
freight : '', // 运费
total : '' // 总金额
},
notice : {
remark : '', // 购买须知
content : '', // 内容介绍
noticeShow : true ,// 购买须知状态
notification: ''
},
buyWay : {
platformCp : [], // 选择提交数组
platIndex : 0, // 选择提交方式下标
isdeliver : -1 // 选择提交方式
},
address : {
allAddress : [], // 收货地址列表
addressShow : false // 地址显示状态
},
disabled : false, //购买按钮状态
pointMoreShow : false,
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.rightData.logId = options.luck_id
// 判断是否微信授权登录过 只有外部游览器才用到(支付需要授权微信环境)
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
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-抽奖活动
getApp().globalData.envType = 'drawEnv'
// 获取详情
this.rightsInfo();
},
methods: {
// 详情
rightsInfo() {
activityBuy({activity_exchange_log_id: this.rightData.logId, qty: 1}).then(res => {
this.rightData.detail = res.detail
this.rightData.moreAmount = res.amount
this.rightData.total = res.total
this.rightData.freight = res.freight
this.rightData.addressSee = res.address
this.address.allAddress = res.all_address
this.notice.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notice.content = res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notice.notification = res.detail.notification.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err => {})
},
// 须知展开收起状态
noticeTap() {
this.notice.noticeShow = !this.notice.noticeShow
},
// 收银台跳转
payment() {
exchangesBuy({
name : '',
mobile : '',
address : '',
activity_exchange_item_goods_id: '',
activity_exchange_log_id: this.rightData.logId,
qty : 1
}).then(res=>{
this.tradeNo = res.trade_no
this.wxBrowser()
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
});
},
// 当支付环境为微信游览器情况下
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(() => {
let wechaUrl = 'payments/wechat'
h5Pay(wechaUrl, {
channel: 'h5',
trade_no: this.tradeNo,
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 => {
// 支付成功
uni.redirectTo({
url: 'order?type=paid'
})
},
cancel: () =>{
// 取消支付
uni.redirectTo({
url: 'order?type=unpay'
})
}
})
})
})
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
if (!err.login) {
uni.reLaunch({
url: '/pages/draw/signin'
});
}
})
},
/**
* 重要提示显示
*/
pointMoreTap() {
this.pointMoreShow = !this.pointMoreShow
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #eeeeee;
}
/* 权益内容 */
.cont {
width: 100%;
overflow: hidden;
.contBack {
position: relative;
width: 200%;
height: 340rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
.classBack {
position: absolute;
left: 28%;
right: 30%;
width: 44%;
top: 40rpx;
}
}
.classCircle::after,
.contBack::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
.classCircle::after {
left: 20%;
top: -20rpx;
width: 260rpx;
height: 260rpx;
}
.contBack::before {
right: 20%;
top: 55%;
width: 300rpx;
height: 300rpx;
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(28% - 2rpx);
right: calc(30% - 2rpx);
width: calc(44% + 4rpx);
top: 50rpx;
.welfareCont-top{
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 50rpx 0 20rpx;
height: 120rpx;
.welfareCont-list-img {
border-radius: 50%;
width: 120rpx;
height: 120rpx;
display: inline-block;
margin: 0 15rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.rightsCont-btn {
background: rgba(255, 255, 0255, .4);
width: 100%;
line-height: 70rpx;
font-size: 40rpx;
font-weight: 600;
color: #000000;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
// 数量
.rightsNumber {
background-color: #ffffff;
position: relative;
padding: 40rpx;
box-sizing: border-box;
.rightsGoods-img {
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 60rpx 40rpx 0 230rpx;
box-sizing: border-box;
.rightsGoods-text {
font-size: 36rpx;
margin-bottom: 35rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
.rightsGoods-number {
flex: 1;
font-size: 34rpx;
text {
font-size: 28rpx;
}
}
.rightsAdd {
display: flex;
.rightsAdd-btn {
border-radius: 4rpx;
text-align: center;
width: 50rpx;
height: 50rpx;
line-height: 45rpx;
font-size: 40rpx;
font-weight: 600;
}
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input {
width: 100rpx;
text-align: center;
font-size: 28rpx;
line-height: 50rpx;
}
}
}
}
}
// 地址
.rightsList,
.notice,
.detailsStore {
background: white;
padding: 10rpx 0;
box-sizing: border-box;
}
.rightsLabel,
.rightsLabel-pay {
display: flex;
padding: 20rpx 40rpx;
color: #6c6c6c;
font-weight: 600;
font-size: 30rpx;
}
.rightsLabel-left {
flex: 1;
color: #747d86;
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
}
}
.rightsLabel-range {
display: flex;
color: #000;
font-weight: 600;
}
.rightsLabel-address {
display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
&::after,
&::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
&::after {
top: 0;
}
&::before {
bottom: 0;
}
.rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-right {
width: calc(100% - 80rpx);
margin-left: 10rpx;
display: flex;
font-size: 28rpx;
.rightsLabel-address-text {
flex: 1;
color: #000000;
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
}
}
}
}
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
margin: 0 0 0 6rpx;
}
// 购买须知
.notice {
background: white;
padding: 30rpx 20rpx;
box-sizing: border-box;
.noticeTitle {
display: flex;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
line-height: 46rpx;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 46rpx;
height: 46rpx;
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-top {
margin: 30rpx 0 10rpx;
font-weight: 600;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
.newrightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 160rpx;
z-index: 9;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
text {
font-size: 38rpx;
color: #fe2d55;
}
}
button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
}
// 选择收货地址
.addressBack {
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .4);
z-index: 10;
width: 100%;
height: 100%;
display: none;
&.active {
display: block;
}
}
.addressCont {
position: fixed;
left: 0;
bottom: -1000%;
transition: .2s;
background: #fff;
z-index: 11;
width: 100%;
&.active {
bottom: 0;
}
.addressCont-title {
height: 90rpx;
line-height: 90rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 600;
position: relative;
&::after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-left {
flex: 1;
}
.addressCont-right {
color: #309ded;
}
}
.header-classify {
white-space: nowrap;
box-sizing: border-box;
height: 600rpx;
.addressCont-list {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
overflow: hidden;
position: relative;
&::after {
position: absolute;
content: '';
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-top {
display: flex;
margin-bottom: 10rpx;
.addressCont-name {
font-weight: 600;
}
}
.addressCont-text {
color: #666;
width: calc(100% - 160rpx);
}
.address-tool-icon {
width: 120rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 4rpx;
text-align: center;
color: #fff;
position: absolute;
top: 45rpx;
right: 10rpx;
background: #dfae2e;
transform: scale(.9, .9);
font-size: 24rpx;
}
}
}
}
.rightsPoint {
position: fixed;
left: 0;
bottom: 160rpx;
background: #eeeeee;
z-index: 9;
width: 100%;
padding: 20rpx 20rpx 10rpx;
box-sizing: border-box;
}
.rightsPoint-cont {
width: 100%;
background: #eeeeee;
border-radius: 10rpx;
position: relative;
max-height: 50vh;
overflow-y: scroll;
}
.rightsPoint-top {
font-size: 28rpx;
display: flex;
padding: 0 20rpx 20rpx;
box-sizing: border-box;
font-weight: 600;
}
.rightsPoint-top image {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
.rightsPoint-text {
padding: 0 20rpx;
box-sizing: border-box;
font-size: 24rpx;
line-height: 44rpx;
height: 90rpx;
transition: height 25s;
overflow: hidden;
}
.rightsPoint-text.active {
height: auto;
transition: 2s;
}
.rightsPoint-text view {
position: relative;
padding-left: 40rpx;
}
.rightsPoint-text view::after {
position: absolute;
content: '';
left: 10rpx;
top: 20rpx;
background: #000;
width: 10rpx;
height: 10rpx;
border-radius: 50%;
}
.rightsPoint-bolck {
position: absolute;
top: 0;
left: 0;
height: calc(100% - 40rpx);
}
.pointMore {
text-align: center;
width: 100%;
background: #eeeeee;
height: 80rpx;
line-height: 82rpx;
position: relative;
margin-top: 10rpx;
}
.pointMore::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 2rpx;
background: #f2ecde;
}
.pointMore text {
font-size: 28rpx;
color: #c38e00;
animation: dong 1.8s infinite;
display: inline-block;
}
.pointMore image {
width: 30rpx;
height: 30rpx;
margin-left: 4rpx;
vertical-align: -4rpx;
animation: dong 1.8s infinite;
}
@keyframes dong {
0% {
transform: translate(0px, 0px);
}
50% {
transform: translate(0px, -6rpx);
}
100% {
transform: translate(0px, 0px);
}
}
</style>

View File

@@ -0,0 +1,111 @@
<template>
<view class="content">
<image class="drawTitle" src="@/static/img/draw-title.png" mode="widthFix"></image>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="6" type="password" placeholder="请设置登录密码" name="password" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="6" type="password" placeholder="请确认登录密码" name="newpassword" placeholder-style="color:#c9c9c9;"></input>
</view>
<button class="campus-form-btn" form-type="submit">立即找回</button>
</form>
</view>
</view>
</template>
<script>
import { passSetup } from '@/apis/interfaces/auth'
export default {
data() {
return {
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
// 立即登录
forgetlogin(e){
let newPass = e.detail.value.newpassword || '',
password = e.detail.value.password || ''
passSetup({
password: password,
password_confirmation: newPass
}).then(res => {
uni.showToast({
title: "密码重置成功",
icon : 'none'
})
uni.reLaunch({
url: '/pages/draw/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f67b5a;
}
.drawTitle {
width: 100%;
}
.campus-cont {
padding: 10rpx 50rpx 0;
box-sizing: border-box;
.campus-inputs {
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
height: 100rpx;
line-height: 100rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
.campus-form-icon {
width: 50rpx;
height: 50rpx;
margin: 25rpx 20rpx 0 0;
}
.campus-form-input {
width: calc(100% - 70rpx);
height: 100%;
line-height: 100rpx;
font-size: 32rpx;
}
}
.campus-form-btn {
background-color: #ffe455;
border-radius: 10rpx;
line-height: 100rpx;
font-size: 36rpx;
color: #6a4902;
margin-top: 40rpx;
box-shadow: 4rpx 4rpx 6rpx #c62024;
}
.login-box {
line-height: 90rpx;
padding: 0 10rpx;
box-sizing: border-box;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
}
}
</style>

View File

@@ -0,0 +1,125 @@
<template>
<view class="content">
<image class="drawTitle" src="@/static/img/draw-title.png" mode="widthFix"></image>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="11" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/draw_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" maxlength="6" type="password" placeholder="请输入登录密码" name="password" placeholder-style="color:#c9c9c9;"></input>
</view>
<view class="resPassword">
</view>
<button class="campus-form-btn" form-type="submit">立即登录</button>
</form>
<view class="login-box">
<navigator class="login-box-flex" hover-class="none" url="register">快速注册</navigator>
<navigator hover-class="none" url="password">忘记密码</navigator>
</view>
</view>
</view>
</template>
<script>
import { passlogin } from '@/apis/interfaces/auth'
export default {
data() {
return {
mobileNo : '', // 手机号
disabled : false,
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
password = e.detail.value.password || ''
passlogin({
mobile : mobileNo,
password: password
}).then(res => {
this.$store.commit('setToken', res.token)
uni.reLaunch({
url: '/pages/draw/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f67b5a;
}
.drawTitle {
width: 100%;
}
.campus-cont {
padding: 10rpx 50rpx 20rpx;
box-sizing: border-box;
.campus-inputs {
background-color: #FFFFFF;
border-radius: 10rpx;
margin-bottom: 30rpx;
height: 100rpx;
line-height: 100rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
.campus-form-icon {
width: 50rpx;
height: 50rpx;
margin: 25rpx 20rpx 0 0;
}
.campus-form-input {
width: calc(100% - 70rpx);
height: 100%;
line-height: 100rpx;
font-size: 32rpx;
}
}
.campus-form-btn {
background-color: #ffe455;
border-radius: 10rpx;
line-height: 100rpx;
font-size: 36rpx;
color: #6a4902;
margin-top: 40rpx;
box-shadow: 4rpx 4rpx 6rpx #c62024;
}
.login-box {
display: flex;
line-height: 90rpx;
padding: 0 10rpx;
box-sizing: border-box;
color: #FFFFFF;
font-size: 32rpx;
.login-box-flex {
flex: 1;
}
}
}
</style>

View File

@@ -0,0 +1,74 @@
<template>
<view class="content">
<view class="examine">
<image src="https://lifetest.ysd-bs.com/storage/materials/2022/09/26/pxdn3_03.png" mode="widthFix"></image>
<view class="text">
<view class="title">兑换成功</view>
<view class="time">管理员审核后,尽快给你发货,请您耐心等待</view>
</view>
<view @click="orderClick" class="return">我的订单</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-用户抽奖活动
getApp().globalData.envType = 'drawEnv'
},
methods: {
orderClick() {
uni.redirectTo({
url: 'order?type=paid'
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
.examine {
padding: 240rpx 0 30rpx;
box-sizing: border-box;
text-align: center;
}
.examine image {
width: 80%;
margin: 0 auto 30rpx;
}
.title {
font-weight: 600;
font-size: 42rpx;
margin-bottom: 30rpx;
color: #f33111;
}
.time {
color: #999999;
line-height: 50rpx;
}
.return {
font-size: 34rpx;
display: inline-block;
margin-top: 80rpx;
background-color: #f33111;
padding: 0 180rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 10rpx;
box-shadow: 0 3rpx 6rpx 4rpx rgba(214, 6, 6, .6);
color: #FFFFFF;
}
</style>

View File

@@ -0,0 +1,367 @@
<template>
<view>
<view class="favourTitle">
<image class="favourTitle-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/favour_title.png" mode="widthFix"></image>
</view>
<view class="favourBack" v-if="typeArr[typeIndex]">
<image class="favourBack-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/favour_back.png" mode="widthFix"></image>
<view class="favourBack-cont-title">我的{{ typeArr[typeIndex].value }}</view>
<view class="favourBack-cont">
<view class="favourBack-cont-name">{{ typeArr[typeIndex].value }}</view>
<view class="favourBack-cont-number">
<text>{{ typeArr[typeIndex].key == 'silver' ? account.silver : account.drill }}</text>
</view>
</view>
<view class="favourCont">
<view class="favourBlack">
<view class="favourCont-title">赠好友消费红包</view>
<form @submit="formSubmit">
<view class="favourCont-label">
<view class="favourCont-name">账户类型</view>
<picker class="favourCont-picker" :range="typeArr" :range-key="'value'" @change="typeBind">
<view class="tabs-text">
{{ typeArr[typeIndex].value }}
</view>
<image src="/static/icon/rightsArrow.png"></image>
</picker>
</view>
<view class="favourCont-label">
<view class="favourCont-name">好友手机号</view>
<view class="favourCont-check">
<input type="number" @input="bindKeyInput" placeholder="输入好友手机号" />
<view class="favourCont-check-btn" @tap="checkTel">校验号码</view>
</view>
</view>
<view class="favourCont-label">
<view class="favourCont-name">转账金额</view>
<input type="digit" name="amount" placeholder="请输入转账金额" />
</view>
<view class="favourCont-label">
<view class="favourCont-name">支付密码</view>
<input type="number" name="paypass" placeholder="请输入支付密码" password />
</view>
<button class="favourCont-btn" formType="submit" :disabled="disabled">立即转入</button>
</form>
</view>
<navigator class="favourCont-record" v-if="typeArr[typeIndex]" hover-class="none" :url="'/pages/account/account?type=' + typeArr[typeIndex].key"><text>赠予记录</text>
</navigator>
</view>
</view>
<!-- 校验手机号弹出 -->
<view class="popTel-back" v-if="popShow"></view>
<view class="popTel" v-if="popShow">
<view class="popTel-title">当前转入的账户信息</view>
<view class="popTel-cont">
<image class="popTel-head" :src="userInfo.avatar"></image>
<view class="popTel-name">{{ userInfo.nickname }}</view>
</view>
<view class="popTel-btn" @tap="popHide">知道了</view>
</view>
</view>
</template>
<script>
import { transfers, ajaxTel, transfersForm } from '@/apis/interfaces/user'
export default {
data() {
return {
account : '', //账户积分
typeArr : [], //转账类型
typeIndex: 0, //转账下标
userInfo : '', //转账用户信息
mobile : '', //转账手机号
disabled : false, //支付按钮状态
popShow : false //校验弹出层
}
},
onLoad(options) {
// 获取账户下拉列表
this.accountList();
},
methods: {
// 账户下拉列表
accountList() {
transfers().then(res=>{
this.account = res.account
this.typeArr = res.accounts
}).catch(err=>{})
},
// 账户下拉选择
typeBind(e) {
this.typeIndex = e.detail.value
},
// 转入的手机号
bindKeyInput(val){
this.mobile = val.detail.value
},
// 校验手机号码
checkTel() {
ajaxTel(this.mobile).then(res=>{
this.userInfo = res
this.popShow = !this.popShow
}).catch(err=>{})
},
// 关闭校验弹出
popHide() {
this.popShow = !this.popShow
},
// 提交表单
formSubmit(e) {
// 检查用户登录状态
const Paypass = uni.getStorageSync("hasPaypass")
if(Paypass == false) {
uni.showModal({
title : '提示',
content : '抱歉,您还没有设置支付密码',
success : res=> {
if (res.confirm) {
uni.navigateTo({
url: '/pages/payPassword/setup?source=favourUrl'
})
} else if (res.cancel) {}
}
})
return
}
let newAmount = e.detail.value.amount,
newMobile = this.mobile,
newPaypass = e.detail.value.paypass,
newType = this.typeArr[this.typeIndex].key
transfersForm({
mobile: newMobile,
type: newType,
amount: newAmount,
paypass: newPaypass
}).then(res=>{
this.disabled = true
uni.showToast({
title: '转入成功',
})
setTimeout(()=>{
uni.redirectTo({
url: "/pages/account/account?type=" + newType
})
},2000)
}) .catch(err=>{
uni.showToast({
title: err.message,
icon:'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #000000;
}
.favourTitle {
text-align: center;
margin: 40rpx 0;
}
.favourBack{
position: relative;
width: 100vw;
}
.favourBack-img {
width: 100vw;
display: block;
}
.favourBack-cont {
position: absolute;
top: 100rpx;
left: 0;
padding-left: 14%;
z-index: 1;
color: #606060;
width: 100%;
box-sizing: border-box;
}
.favourBack-cont-number {
color: #000000;
width: 100%;
margin-top: 20rpx;
text {
font-size: 50rpx;
font-weight: 600;
padding-right: 10rpx;
display: inline-block;
}
}
.favourBack-cont-title {
position: absolute;
top: 0;
left: 0;
width: 100%;
text-align: center;
font-size: 26rpx;
line-height: 50rpx;
}
.favourCont {
background-color: #ffffff;
padding: 40rpx 50rpx;
width: 100%;
box-sizing: border-box;
border-radius: 5rpx 5rpx 0 0;
}
.favourBlack {
background-color: #e9e9e9;
padding: 40rpx;
box-sizing: border-box;
border-radius: 45rpx;
}
.favourCont-record {
line-height: 90rpx;
text-align: center;
font-size: 34rpx;
}
.favourCont-title {
font-size: 45rpx;
text-align: center;
}
.favourCont-label {
display: flex;
margin-top: 40rpx;
font-size: 28rpx;
input {
font-size: 28rpx;
}
}
.favourCont-check,
.favourCont-picker,
.favourCont-label>input {
background-color: #c9c9c9;
display: flex;
width: calc(100% - 160rpx);
padding: 0 20rpx;
box-sizing: border-box;
height: 80rpx;
line-height: 80rpx;
}
.favourCont-picker {
position: relative;
image {
width: 40rpx;
height: 40rpx;
position: absolute;
right: 0;
top: 20rpx;
z-index: 2;
}
input {
height: 80rpx;
line-height: 80rpx;
}
}
.favourCont-check input,
.favourCont-picker input {
height: 80rpx;
line-height: 80rpx;
}
.favourCont-name {
width: 160rpx;
line-height: 80rpx;
}
.favourCont-check-btn {
width: 150rpx;
text-align: center;
background-color: #a1a1a1;
line-height: 60rpx;
height: 60rpx;
margin-top: 10rpx;
font-size: 24rpx;
}
.favourCont-btn {
width: 100% !important;
background-color: #dbc190;
margin-top: 40rpx;
border-radius: 60rpx;
}
.tabs-text {
width: 100%;
position: absolute;
left: 0;
top: 0;
padding-left: 20rpx;
box-sizing: border-box;
}
/* 校验弹出层 */
.popTel-back {
position: fixed;
left: 0;
top: 0;
background: rgba(0, 0, 0, .7);
width: 100vw;
height: 100vh;
z-index: 10;
}
.popTel {
position: fixed;
left: 140rpx;
right: 140rpx;
top: 30%;
z-index: 11;
background-color: #fff;
border-radius: 20rpx;
text-align: center;
overflow: hidden;
}
.popTel-title {
font-size: 32rpx;
background-color: #ff8e65;
color: #fff;
line-height: 80rpx;
}
.popTel-cont {
padding: 60rpx 0;
}
.popTel-head {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin: 0 auto 20rpx;
border: #ff8e65 solid 2rpx;
}
.popTel-btn {
border-top: 2rpx solid #dedede;
line-height: 90rpx;
color: #ff8e65;
font-size: 30rpx;
}
</style>

View File

@@ -0,0 +1,456 @@
<template>
<view>
<view v-if="frozenData.length > 0">
<view class="grantSwiper">
<swiper class="banner-swiper" @change="monitorCurrent" :current="current">
<swiper-item v-for="(item,index) in frozenData" :key="index">
<view class="banner-height">
<view class="grantTop">
<image class="grantTop-img" src="https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_back.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>{{ item.ungrant }}
</view>
</view>
<view class="grantTop-tips">
<view class="grantTop-time">发放周期 {{ item.cycle }}</view>
<view class="grantTop-number">{{ item.num }}</view>
</view>
</view>
<view class="grantTitle">
<view class="nowrap grantTitle-name">{{ item.source.remark }}</view>
<view class="grantTitle-tel">{{ item.mobile }}</view>
</view>
</view>
<view class="grantIssue">
<view class="grantIssue-title">
<view class="grantIssue-title-name">
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_icon.png"></image><text>消费红包分期发放</text>
</view>
<view class="grantIssue-title-tips">
应发余额<text>{{ item.variable }}</text>发放期数<text>{{ item.num }}</text>每期发放<text>{{ item.avg }}/</text>
</view>
</view>
<view class="grantIssue-list">
<block v-if="item.items.length > 0">
<view class="grantIssue-label" v-for="(listItem,indexItem) in item.items" :key="indexItem">
<image class="grantIssue-label-img" :class="{active : listItem.status == 0}" 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 : listItem.status == 0}">
<text>{{listItem.num}}</text></view>
<view class="grantIssue-left-number" :class="{active : listItem.status == 0}">
<text>{{item.items.length}}</text></view>
</view>
<view class="grantIssue-label-center">
<view class="grantIssue-center-top" :class="{active : listItem.status == 0}">
<text>{{listItem.variable}}</text>( 发放额度 )
</view>
<view class="grantIssue-center-time">发放时间{{listItem.start_at}}</view>
</view>
<view class="grantIssue-label-right" :class="{active : listItem.status == 0}">
{{listItem.status_text}}
</view>
</view>
<image class="grantIssue-label-tips" :class="{active : listItem.status == 0}" src="https://card.ysd-bs.com/storage/materials/2021/09/01/frozen_btn.png" mode="scaleToFill">
</image>
</view>
</block>
<!-- 暂无内容 -->
<view class="grantIssue-pack" v-else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/Account_icon_tips.png"></image>
<view>抱歉目前发放期数~</view>
</view>
</view>
</view>
</swiper-item>
</swiper>
</view>
<view class="frozenArrow">
<view class="frozenArrow-left" v-if="current != 0">
<image src="/static/icon/frozen_arrow.png"></image>
返回上一个权益
</view>
<view class="frozenArrow-right" v-if="current == 0 || frozenData[frozenData.length - 1] > 0">
<image src="/static/icon/frozen_arrow.png"></image>
查看下一个权益
</view>
</view>
<!-- 自定义轮播图进度点 -->
<view class="dots">
<block v-for="(item,index) in frozenData" :key="index">
<view :class="{active : index == current}"></view>
</block>
</view>
</view>
<!-- 暂无内容 -->
<view class="no-pack-center pack-center pages-hint" wx:else>
<image src="https://card.ysd-bs.com/storage/materials/2021/09/01/Account_icon.png"></image>
<view>抱歉目前暂无内容~</view>
</view>
</view>
</template>
<script>
import { ungrants } from '@/apis/interfaces/user'
export default {
data() {
return {
current : 0, // 轮播标
type : '', // 类型
frozenData : [], // 数组列表
blockeds : '', // 待发放金额
}
},
onLoad(options) {
this.type = options.type,
this.blockeds = options.blockeds
// 获取冻结列表
this.frozenInfo()
},
methods:{
// 冻结列表
frozenInfo() {
ungrants(this.type).then(res=>{
this.frozenData = res
})
},
// 轮播滑动
monitorCurrent(e) {
this.current = e.detail.current
}
}
}
</script>
<style lang="scss" scoped>
page,
.no-pack-center {
background-image: linear-gradient(to bottom, #24315d, #24315d);
}
.no-pack-center {
color: #fff;
}
.grantSwiper {
width: 100%;
height: 100vh;
padding: 0 40rpx;
box-sizing: border-box;
.banner-swiper {
height: 100vh;
overflow: hidden;
swiper-item {
padding: 0 20rpx;
box-sizing: border-box;
}
.banner-height {
height: 460rpx;
margin-top: 30rpx;
.grantTop {
position: relative;
width: 100%;
height: 300rpx;
color: #ffdf95;
.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;
image {
width: 120rpx;
height: 40rpx;
}
.grantTop-price {
text-align: center;
font-size: 60rpx;
text {
font-size: 30rpx;
display: block;
color: #fff;
}
.grantTop-price-tips {
display: inline-block;
font-size: 40rpx;
}
}
}
.grantTop-tips {
bottom: 0;
font-size: 26rpx;
display: flex;
line-height: 70rpx;
height: 70rpx;
padding: 0 20rpx;
box-sizing: border-box;
.grantTop-time {
flex: 1;
}
}
}
.grantTitle {
background-color: #3d4963;
border-radius: 15rpx;
margin: 40rpx 0;
width: 100%;
display: flex;
color: #d3d5e1;
height: 90rpx;
overflow: hidden;
.grantTitle-name,
.grantTitle-tel {
box-sizing: border-box;
height: 90rpx;
line-height: 90rpx;
font-size: 30rpx;
}
.grantTitle-name {
padding-left: 20rpx;
font-weight: 600;
background-image:-webkit-linear-gradient(left,#fbdebe,#e5ad7a);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
flex: 1;
}
.grantTitle-tel {
padding: 0 30rpx 0 20rpx;
background-color: #192845;
position: relative;
&::after {
position: absolute;
content: '';
left: -20rpx;
top: 0;
width:0;
height:0;
border-left: 20rpx solid transparent;
border-right: 20rpx solid transparent;
border-bottom: 90rpx solid #192845;
}
}
}
}
.grantIssue {
height: calc(100vh - 550rpx);
.grantIssue-title {
height: 120rpx;
.grantIssue-title-name {
line-height: 44rpx;
display: flex;
image {
width: 42rpx;
height: 42rpx;
margin-right: 20rpx;
}
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;
text {
color: #dcbc8d;
}
}
}
.grantIssue-list {
overflow-y: scroll;
height: calc(100% - 140rpx);
.grantIssue-label {
position: relative;
height: 180rpx;
margin-bottom: 30rpx;
border-radius: 10rpx;
overflow: hidden;
background-color: #f9dabb;
.grantIssue-label-img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.grantIssue-label-tips {
position: absolute;
width: 140rpx;
height: 100%;
right: 0;
top: 0;
}
.grantIssue-label-img.active,
.grantIssue-label-tips.active {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
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: 120rpx;
text-align: center;
margin-top: 20rpx;
.grantIssue-left-top {
color: #e9083d;
font-size: 26rpx;
text {
font-size: 34rpx;
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;
&.active {
background: -webkit-linear-gradient(left,#e2e2e2,#e2e2e2);
color: gray;
}
}
}
.grantIssue-label-center {
width: calc(100% - 240rpx);
margin: 20rpx 20rpx 0 20rpx;
.grantIssue-center-top {
font-size: 26rpx;
color: #0f004a;
font-weight: 600;
margin-bottom: 8rpx;
text {
font-size: 40rpx;
padding-right: 10rpx;
}
}
.grantIssue-center-time {
font-size: 26rpx;
color: #757575;
}
}
.grantIssue-label-right {
width: 80rpx;
font-weight: 600;
text-align: center;
font-size: 26rpx;
color: #3d2a26;
line-height: 140rpx;
}
.grantIssue-left-top.active,
.grantIssue-center-top.active,
.grantIssue-label-right.active {
color: gray;
}
}
}
}
}
}
}
// 滑动箭头
.frozenArrow-left,
.frozenArrow-right {
position: fixed;
z-index: 9;
top: 35%;
width: 40rpx;
height: 40rpx;
text-align: center;
writing-mode:lr-tb;
color: #f0cba8;
font-size: 24rpx;
}
.frozenArrow-left {
left: 8rpx;
-webkit-animation: bounce-left 1s linear infinite;
animation: bounce-left 1s linear infinite;
image {
transform:rotate(180deg);
-moz-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
}
}
.frozenArrow-right {
right: 8rpx;
-webkit-animation: bounce-right 1s linear infinite;
animation: bounce-right 1s linear infinite;
}
@keyframes bounce-left {
25% {transform: translateX(3px);}
50%, 100% {transform: translateX(0);}
75% {transform: translateX(-3px);}
}
@keyframes bounce-right {
25% {transform: translateX(-3px);}
50%, 100% {transform: translateX(0);}
75% {transform: translateX(3px);}
}
.frozenArrow-left image,
.frozenArrow-right image {
width: 24rpx;
height: 24rpx;
}
// 指示点
.dots {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
position: fixed;
bottom: 20rpx;
height: 40rpx;
view {
width: 14rpx;
height: 14rpx;
margin: 0 6rpx;
border-radius: 50%;
background-color: #c5c5c5;
&.active {
width: 24rpx;
border-radius: 40rpx;
background-color: #ffdf95;
}
}
}
</style>

View File

@@ -0,0 +1,812 @@
<template>
<view>
<!-- 按钮 -->
<view class="newrightsBtn" @tap="payment">
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">{{ rightData.num }}件商品 </view>
<view>实付<text>{{ rightData.total }}</text></view>
</view>
<button :disabled="disabled">立即购买</button>
</view>
<!-- 卡券 -->
<view style="padding-bottom: 240px">
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://lifetest.ysd-bs.com/storage/materials/2021/08/09/class_back_02.png" mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont">
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" v-for="(item, index) in rightData.detail.logos" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
</scroll-view>
<view class="nowrap rightsCont-btn">
{{ rightData.detail.four_title }}
</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="rightsNumber">
<image class="rightsGoods-img" :src="rightData.detail.cover" mode="aspectFill"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{ rightData.detail.five_title }}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number"><text></text>{{ rightData.detail.price }}</view>
<view class="rightsAdd">
<view class="rightsAdd-btn rightsAdd-remove" :class="{active : rightData.num != 1}" @click="goodsNumber('remove')">-</view>
<input class="rightsAdd-input" :data-num="rightData.num" :value="rightData.num" type="number" disabled=""></input>
<view class="rightsAdd-btn rightsAdd-plus" @click="goodsNumber('plus')">+</view>
</view>
</view>
</view>
</view>
<!-- 金额 -->
<view class="rightsList" v-if="rightData.detail">
<view class="rightsLabel">
<view class="rightsLabel-left">{{ rightData.detail.attribute.form_type }}</view>
<view class="rightsLabel-right rightsLabel-red">-{{ rightData.detail.score }}</view>
</view>
</view>
<!-- 收货地址 -->
<block v-if="buyWay.platformCp[buyWay.platIndex]">
<view class="rightsList" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<block v-if="rightData.detail.type == 'physical'">
<view class="rightsLabel">
<view class="rightsLabel-left">提交方式</view>
<view class="rightsLabel-right rightsLabel-range">
<picker :value="buyWay.platIndex" :range-key="'name'" :range="buyWay.platformCp" range-key="name" @change="platBind">
<view class="tabs-text">
{{ buyWay.platformCp[buyWay.platIndex].name }}
</view>
</picker>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</view>
<view class="rightsLabel rightsLabel-address" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<image class="rightsLabel-icon" src="/static/img/new_rightsAddress.png"></image>
<block v-if="rightData.addressSee != ''">
<view class="rightsLabel-right" @tap="addressTap">
<view class="rightsLabel-address-text">
<view class="rightsLabel-address-name">{{ rightData.addressSee.name }}<view class="rightsLabel-address-tel">{{ rightData.addressSee.mobile }}</view></view>
<text class="nowrap">{{ rightData.addressSee.all_address }}</text>
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</block>
<block v-else>
<navigator class="rightsLabel-right" hover-class="none" url="/pages/address_form/address_form?type=Add">
<view class="rightsLabel-address-text" style="line-height: 90rpx;">
添加收货地址
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</navigator>
</block>
</view>
<view class="rightsLabel" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<view class="rightsLabel-left">快递运费</view>
<view class="rightsLabel-right rightsLabel-freight">{{ rightData.freight }}</view>
</view>
</block>
</view>
</block>
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @click="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读使用须知内容介绍
</view>
<image class="noticeTitle-row" :class="{active : notice.noticeShow}" src="/static/icon/rightsArrow.png"></image>
</view>
<view class="noticeText" :class="{active : notice.noticeShow}">
<view class="noticeText-top">购买须知</view>
<view class="noticeText-cont" v-if="notice.remark">
<rich-text :nodes="notice.remark"></rich-text>
</view>
<view class="noticeText-top">内容介绍</view>
<view class="noticeText-cont" v-if="notice.content">
<rich-text :nodes="notice.content"></rich-text>
</view>
</view>
</view>
<!-- 重要提示 -->
<view class="rightsPoint">
<view class="rightsPoint-cont">
<view class="rightsPoint-top">
<image src="/static/icon/Point_icon.png"></image>
<text>重要提示</text>
</view>
<view class="rightsPoint-text" :class="{active : notes.pointMoreShow}">
<rich-text :nodes="notes.notification"></rich-text>
</view>
<view class="pointMore" @click="pointMoreTap">
<text>{{ notes.pointMoreShow == true ? '收起' : '展开' }}</text>
<image :src="notes.pointMoreShow == true ? '/static/img/pointMore-up.png' : '/static/img/pointMore.png'">
</image>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { buy, buySubmit } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
rightData: {
detail : '', // 权益内容
rightId : '', // 权益id
addressSee : '', // 收货地址
num : 1, // 购买数量
moreAmount : '', // 产品总金额
freight : '', // 运费
total : '' // 总金额
},
notice : {
remark : '', // 购买须知
content : '', // 内容介绍
noticeShow : true // 购买须知状态
},
buyWay : {
platformCp : [], // 选择提交数组
platIndex : 0, // 选择提交方式下标
isdeliver : -1 // 选择提交方式
},
address : {
allAddress : [], // 收货地址列表
addressShow : false // 地址显示状态
},
notes : {
notification : '', // 重要提示-内容
pointMoreShow : false// 重要提示-展开收起
},
disabled : false, //购买按钮状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.rightData.rightId = options.id
// this.code = options.code || ''
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
// 获取详情
this.rightsInfo();
},
methods: {
// 详情
rightsInfo() {
buy({activity_month_id: this.rightData.rightId, qty: this.rightData.num}).then(res => {
let obj = res.detail.express
let arr = new Array
arr = Object.keys(obj).map(val=>{
return { ...obj[val], ...{key: val} }
})
if(this.buyWay.isdeliver == -1){
if(res.detail.type == 'physical') {
this.buyWay.isdeliver = res.detail.def_get
}
if(res.detail.type == 'virtual') this.buyWay.isdeliver = 1
}
this.rightData.detail = res.detail
this.rightData.moreAmount = res.amount
this.rightData.total = res.total
this.buyWay.platformCp = arr
this.rightData.freight = res.freight
this.rightData.addressSee = res.address
this.address.allAddress = res.all_address
this.notice.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notes.notification = res.detail.notification.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notice.content = res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
})
},
// 商品数量加减
goodsNumber(e){
let num = this.rightData.num
if (e == 'plus'){
num ++;
}else{
if (num > 1){
num --;
}else{
uni.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
}
this.rightData.num = num
// 获取详情
this.rightsInfo()
},
// 须知展开收起状态
noticeTap() {
this.notice.noticeShow = !this.notice.noticeShow
},
// 重要提示展开-收起
pointMoreTap() {
this.notes.pointMoreShow = !this.notes.pointMoreShow
},
// 收银台跳转
payment() {
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 => {
uni.navigateTo({
url: '/pages/cashier/index?tradeNo=' + res.trade_no + '&type=giftPEnv' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
}).catch(err => {
uni.showToast({
title : err.message,
icon : 'none'
})
});
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #FFFFFF;
}
/* 权益内容 */
.cont {
width: 100%;
overflow: hidden;
.contBack {
position: relative;
width: 200%;
height: 340rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
.classBack {
position: absolute;
left: 28%;
right: 30%;
width: 44%;
top: 40rpx;
}
}
.classCircle::after,
.contBack::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
.classCircle::after {
left: 20%;
top: -20rpx;
width: 260rpx;
height: 260rpx;
}
.contBack::before {
right: 20%;
top: 55%;
width: 300rpx;
height: 300rpx;
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(28% - 2rpx);
right: calc(30% - 2rpx);
width: calc(44% + 4rpx);
top: 50rpx;
.welfareCont-top{
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 50rpx 0 20rpx;
height: 120rpx;
.welfareCont-list-img {
border-radius: 50%;
width: 120rpx;
height: 120rpx;
display: inline-block;
margin: 0 15rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.rightsCont-btn {
background: rgba(255, 255, 0255, .4);
width: 100%;
line-height: 70rpx;
font-size: 40rpx;
font-weight: 600;
color: #000000;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
// 数量
.rightsNumber {
background-color: #ffffff;
position: relative;
padding: 30rpx 40rpx;
box-sizing: border-box;
.rightsGoods-img {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 80rpx 40rpx 0 270rpx;
box-sizing: border-box;
.rightsGoods-text {
margin-bottom: 40rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
.rightsGoods-number {
flex: 1;
font-size: 34rpx;
text {
font-size: 28rpx;
}
}
.rightsAdd {
display: flex;
.rightsAdd-btn {
border-radius: 4rpx;
text-align: center;
width: 50rpx;
height: 50rpx;
line-height: 45rpx;
font-size: 40rpx;
font-weight: 600;
}
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input {
width: 100rpx;
text-align: center;
font-size: 28rpx;
line-height: 50rpx;
}
}
}
}
}
.rightsList {
border-top: 22rpx #eeeeee solid;
}
// 地址
.rightsList,
.notice,
.detailsStore {
background: white;
padding: 10rpx 0;
box-sizing: border-box;
}
.rightsLabel,
.rightsLabel-pay {
display: flex;
padding: 20rpx 40rpx;
color: #6c6c6c;
font-weight: 600;
font-size: 30rpx;
}
.rightsLabel-left {
flex: 1;
color: #747d86;
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
}
}
.rightsLabel-range {
display: flex;
color: #000;
font-weight: 600;
}
.rightsLabel-address {
display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
&::after,
&::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
&::after {
top: 0;
}
&::before {
bottom: 0;
}
.rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-right {
width: calc(100% - 80rpx);
margin-left: 10rpx;
display: flex;
font-size: 28rpx;
.rightsLabel-address-text {
flex: 1;
color: #000000;
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
}
}
}
}
.rightsLabel-red {
color: #ff5b5d;
}
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
margin: 0 0 0 6rpx;
}
// 购买须知
.notice {
background: white;
padding: 20rpx;
box-sizing: border-box;
border-top: 20rpx #eeeeee solid;
.noticeTitle {
display: flex;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
line-height: 46rpx;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 46rpx;
height: 46rpx;
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-top {
margin: 30rpx 0 10rpx;
font-weight: 600;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
.newrightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 160rpx;
z-index: 9;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
text {
font-size: 38rpx;
color: #fe2d55;
}
}
button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
}
// 选择收货地址
.addressBack {
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .4);
z-index: 10;
width: 100%;
height: 100%;
display: none;
&.active {
display: block;
}
}
.addressCont {
position: fixed;
left: 0;
bottom: -1000%;
transition: .2s;
background: #fff;
z-index: 11;
width: 100%;
&.active {
bottom: 0;
}
.addressCont-title {
height: 90rpx;
line-height: 90rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 600;
position: relative;
&::after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-left {
flex: 1;
}
.addressCont-right {
color: #309ded;
}
}
.header-classify {
white-space: nowrap;
box-sizing: border-box;
height: 600rpx;
.addressCont-list {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
overflow: hidden;
position: relative;
&::after {
position: absolute;
content: '';
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-top {
display: flex;
margin-bottom: 10rpx;
.addressCont-name {
font-weight: 600;
}
}
.addressCont-text {
color: #666;
width: calc(100% - 160rpx);
}
.address-tool-icon {
width: 120rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 4rpx;
text-align: center;
color: #fff;
position: absolute;
top: 45rpx;
right: 10rpx;
background: #dfae2e;
transform: scale(.9, .9);
font-size: 24rpx;
}
}
}
}
/* 重要提示 */
.rightsPoint {
position: fixed;
left: 0;
bottom: 160rpx;
background: #eeeeee;
z-index: 9;
width: 100%;
padding: 20rpx 20rpx 10rpx;
box-sizing: border-box;
.rightsPoint-cont {
width: 100%;
background: #eeeeee;
border-radius: 10rpx;
position: relative;
max-height: 50vh;
overflow-y: scroll;
.rightsPoint-top {
font-size: 28rpx;
display: flex;
padding: 0 20rpx 20rpx;
box-sizing: border-box;
font-weight: 600;
image {
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
}
.rightsPoint-text {
padding: 0 20rpx;
box-sizing: border-box;
font-size: 24rpx;
line-height: 44rpx;
height: 90rpx;
transition: height 25s;
overflow: hidden;
&.active {
height: auto;
transition: 2s;
}
}
.pointMore {
text-align: center;
width: 100%;
background: #eeeeee;
height: 80rpx;
line-height: 82rpx;
position: relative;
margin-top: 10rpx;
&::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 2rpx;
background: #f2ecde;
}
text {
font-size: 28rpx;
color: #c38e00;
animation: dong 1.8s infinite;
display: inline-block;
}
image {
width: 30rpx;
height: 30rpx;
margin-left: 4rpx;
vertical-align: -4rpx;
animation: dong 1.8s infinite;
}
@keyframes dong {
0% {
transform: translate(0px, 0px);
}
50% {
transform: translate(0px, -6rpx);
}
100% {
transform: translate(0px, 0px);
}
}
&::after {
position: absolute;
content: '';
left: 0;
top: 0;
width: 100%;
height: 2rpx;
background: #f2ecde;
}
}
}
}
</style>

View File

@@ -0,0 +1,600 @@
<template>
<view class="content">
<!-- 卡券详情 -->
<view class="details">
<view class="detailsTop">
<view class="detailsTop-name">
{{ details.name }}
</view>
<view class="detailsTop-time">
有效期 {{ details.startTime }} - {{ details.endTime }}
</view>
</view>
<view class="detailsCotent">
<view class="source">活动来源 {{ details.activity_name }}</view>
<view class="detailsBar">
<view class="detailsCode-text">劵码</view>
<image :src="barcode" mode="widthFix"></image>
</view>
<view class="detailsCode-text">
{{ details.code }}
</view>
<view class="detailsCode">
<image :src="qrcode" @click="refreshCode"></image>
<view class="detailsCode-text">
<text>请出示以上券码给网点工作人员</text>
</view>
</view>
<view class="petroNew" v-if="details.right">
<view class="petroNew-btn" v-if="details.right.from == 'petroNew'" @click="urlFrom">
去使用
</view>
</view>
<!-- 门店定位 -->
<view class="detailsStore">
<view class="detailsStore-top">
<view class="detailsStore-title">
适用门店
</view>
<navigator class="detailsStore-row" hover-class="none" :url="'/pages/store/index?id=' + details.id + '&type=campus'" v-if="longitude != 0 && latitude != 0">
查看所有
<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>
</view>
</view>
<!-- 使用须知 -->
<view class="detailsText">
<view class="detailsText-title">
使用须知
</view>
<view class="detailsText-tips">
<rich-text :nodes="remark"></rich-text>
</view>
</view>
<!-- 内容介绍 -->
<view class="detailsText">
<view class="detailsText-title">
内容介绍
</view>
<view class="detailsText-tips" v-if="content != null">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
<!-- 底部 -->
<view class="detailsBottom">
<image src="/static/img/campus_details_back.png" mode="aspectFill"></image>
<view class="detailsBottom-cont">
<view class="detailsBottom-title">
月兑活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>
</template>
<script>
import { qrcode, barcode, couponinfo, merchantCard, breakCode } from '@/apis/interfaces/campus'
export default {
data() {
return {
id : 0, //优惠券id
longitude : 0, //经度
latitude : 0, //纬度
details : '', //优惠券信息
stores : [], //商家列表
content : '', //内容介绍
remark : '', //使用须知
qrcode : '', //二维码
barcode : '', //条形码
merchantcardinfo:'' //商家券信息
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 优惠券id
this.id = options.id
// 获取二维码
qrcode(options.id).then(res=>{
this.qrcode = res.qrcode
})
// 获取条形码
barcode(options.id).then(res=>{
this.barcode = res.barcode
})
},
// 生命周期函数--监听页面显示
onShow() {
// 获取详情信息
this.detailsInfo();
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
// 获取定位信息
uni.getLocation({
success: res => {
this.latitude   = res.latitude
this.longitude  = res.longitude
},
complete: () => {
// 获取详情信息
this.detailsInfo();
}
})
},
methods: {
// 详情信息
detailsInfo() {
couponinfo({
coupon_id: this.id,
user_lng: this.longitude,
user_lat: this.latitude
}).then(res=>{
console.log(res)
let stores = res.stores
stores.map(res=>{
let distance = res.distance
if(res.distance > 1000){
distance = (distance / 1000) + "km"
}else{
distance = distance + "m"
}
res.km = distance
})
this.details = res.info
this.stores = stores
this.remark = res.info.right.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.content = res.info.right.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
//获取商家券信息
if(res.info.card_type=='merchant_card'){
this.getMerchantCardInfo()
}
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
})
},
// 商家券信息
getMerchantCardInfo(){
merchantCard(this.id).then(res=>{
this.merchantcardinfo = res
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
})
},
// 拨打电话
tel(e) {
let tel = e.currentTarget.dataset.tel
uni.showActionSheet({
itemList : ['呼叫商家电话'],
success : res =>{
if(res.tapIndex==0){
uni.makePhoneCall({
phoneNumber: tel
})
}
}
})
},
// 查看门店详情页
detailsTap(e) {
let store_id = e.currentTarget.dataset.id,
user_lng = this.longitude,
user_lat = this.latitude
uni.navigateTo({
url: '/pages/store/details?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat + '&type=campus'
})
},
// 刷新二维码
refreshCode() {
breakCode(this.id).then(res=>{
uni.showToast({
title: '刷新中',
duration: 1000,
icon:'loading'
});
this.qrcode = res.qrcode
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
})
},
urlFrom () {
// #ifdef H5
window.location.href = "https://cloud1-0g37c0kwb91b41c8-1305411715.tcloudbaseapp.com/"
// #endif
}
}
}
</script>
<style>
.content {
background: #cbaf7f;
padding: 20rpx;
box-sizing: border-box;
height: 100%;
overflow-y: scroll;
}
/* 卡券详情 */
.details {
background: #ffffff;
margin: 20rpx 20rpx 0;
width: calc(100% - 40rpx);
position: relative;
border-radius: 0 0 20rpx 20rpx;
border-bottom: 240rpx solid transparent;
box-sizing: border-box;
}
.details::after,
.details::before {
position: absolute;
background: #cbaf7f;
content: '';
top: -50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.details::after {
left: -50rpx;
}
.details::before {
right: -50rpx;
}
.detailsCotent {
padding: 40rpx;
box-sizing: border-box;
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
}
.detailsTop {
border-bottom: 2rpx dashed #c8c8c8;
padding: 40rpx 0;
text-align: center;
box-sizing: border-box;
background-color: #f5f5f5;
}
.detailsTop-name {
font-size: 38rpx;
font-weight: 600;
margin-bottom: 20rpx;
padding: 0 60rpx;
box-sizing: border-box;
}
.detailsTop-time {
color: #7e7e7e;
font-size: 26rpx;
}
.detailsCode {
text-align: center;
padding: 0 0 20rpx;
box-sizing: border-box;
margin: 40rpx 0 20rpx;
}
.detailsCode image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
.detailsCode-text, .detailsStore-row {
color: #949494;
font-size: 28rpx;
}
.detailsCode-text {
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #000;
}
.detailsCode-text text {
color: #999;
font-weight: normal;
font-size: 26rpx;
}
.detailsStore {
border-top: 2rpx #c8c8c8 solid;
padding-top: 40rpx;
}
.detailsStore-top, .detailsStore-row {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
}
.detailsStore-title {
flex: 1;
font-weight: 600;
}
.detailsStore-row image {
width: 26rpx;
height: 26rpx;
margin: 3rpx 0 0 6rpx;
}
.detailsStore-list {
position: relative;
margin-bottom: 40rpx;
}
.detailsStore-list:last-child {
margin-bottom: 0;
}
.detailsStore-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.detailsStore-cont {
position: absolute;
left: 130rpx;
top: 0;
width: calc(100% - 130rpx);
display: flex;
}
.detailsStore-left {
width: calc(100% - 90rpx);
margin-right: 30rpx;
}
.detailsStore-tel {
width: 60rpx;
height: 60rpx;
margin-top: 25rpx;
}
.detailsStore-place {
font-size: 24rpx;
line-height: 40rpx;
color: #5a5a5a;
display: flex;
}
.detailsStore-place text {
flex: 1;
display: inline-block;
font-size: 28rpx;
margin-right: 20rpx;
}
.detailsStore-name {
margin-bottom: 20rpx;
}
.detailsText {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
border-top: 2rpx solid #ececec;
}
.detailsText-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsText-tips {
font-size: 26rpx;
line-height: 50rpx;
color: #555557;
padding-bottom: 20rpx;
}
.detailsCode-join {
color: #ee8e44;
font-size: 24rpx;
border-radius: 50rpx;
border: 2rpx solid #ee8e44;
padding: 10rpx 20rpx;
display: inline-block;
margin-top: 30rpx;
}
.detailsCode-join.active {
border: 2rpx solid #999;
color: #999;
}
.source{
margin: 30rpx 0;
font-size: 28rpx;
}
.location {
background: white;
width: 100%;
text-align: center;
margin: 60rpx 0 0;
}
.location text {
font-size: 28rpx;
display: block;
line-height: 46rpx;
color: #999;
}
.location-btn[size="mini"] {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 66rpx;
margin-top: 30rpx;
}
.location-img {
width: 150rpx;
height: 120rpx;
margin-bottom: 20rpx;
}
.detailsBar {
text-align: center;
padding: 0 50rpx;
box-sizing: border-box;
margin-top: 60rpx;
margin-bottom: 40rpx;
}
.detailsBar image {
width: 100%;
}
.detailsBar .detailsCode-text {
margin-bottom: 10px;
color: #000;
}
.detailsBottom {
position: fixed;
width: 100%;
height: 220rpx;
left: 0;
bottom: 0;
z-index: 9;
}
.detailsBottom image {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.detailsBottom-cont {
z-index: 10;
position: absolute;
left: 0;
top: 70rpx;
width: 100%;
text-align: center;
color: #9a9a9a;
font-size: 26rpx;
}
.detailsBottom-title {
font-weight: 600;
margin-bottom: 20rpx;
font-size: 30rpx;
}
.petroNew {
text-align: center;
}
.petroNew-btn {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 72rpx;
border-radius: 6rpx;
margin: 0 auto 50rpx;
text-align: center;
width: 50%;
}
</style>

View File

@@ -0,0 +1,587 @@
<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>
<!-- 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)">
<view class="indexTab-title">
{{ item.title }}
</view>
<view class="indexTab-number">
({{item.used == 0 ? '剩余' + numbers + '次' : count + '张'}})
</view>
</view>
</view>
<!-- 可兑换 -->
<block v-if="tabType == 0">
<block v-if="giftPackArr.length > 0">
<view class="film" v-for="(item, index) in giftPackArr" :key="index">
<view class="filmTitle">
{{item.title}}
</view>
<view class="filmList" v-for="(items, indexItem) in item.months" :key="indexItem">
<view class="filmList-top">
<view class="filmList-top-name">
{{ items.three_title || '-' }}<text>{{ items.two_title || '-'}}</text>
</view>
<navigator class="filmList-top-price" hover-class="none" :url="'/pages/giftPack/buy?id=' + items.activity_month_id" v-if="items.can.buy">
<view v-if="items.button_text != null">
<view v-for="(btnItem, btnIndex) in items.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</navigator>
<view class="filmList-top-price active" v-else>
<view v-if="items.button_text != null">
<view v-for="(btnItem, btnIndex) in items.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text">
<text>{{ items.name }}</text>
</view>
<view class="filmList-more" @click="moreClick(index)">详细信息<image src="/static/icon/giftPack-icon-yellow.png" class="filmList-more-icon" :class="{active: item.schemesShow }" mode="aspectFill"></image></view>
<view class="filmList-show" v-if="item.schemesShow">
<rich-text :nodes="items.description"></rich-text>
<!-- <text v-for="(itemsDes, indexDes) in items.description" :key="indexDes"></text> -->
</view>
</view>
</view>
</block>
<!-- 列表为空 -->
<view class="campusTips" v-else>
<view class="campusTips-cont">
<image src="/static/img/giftPack-null.png" mode="aspectFill"></image>
<view>暂无可兑换的卡券</view>
</view>
</view>
</block>
<!-- 已兑换 -->
<block v-if="tabType == 1">
<block v-if="couponArr.length > 0">
<view class="coupon" v-for="(item, index) in couponArr" :key="index">
<view class="couponItem">
<view class="couponItem-cont">
<view class="couponItem-top">
<view class="couponItem-cont-number">
<text>{{item.price}}</text>
</view>
<view class="couponItem-cont-name">
<view class="couponItem-cont-title">
{{item.name}}
</view>
<view class="couponItem-cont-show" @click="moreCoupon(index)">
详细信息<image src="/static/icon/giftPack-icon.png" class="couponItem-cont-icon" :class="{active: item.couponShow }" mode="aspectFill"></image>
</view>
</view>
</view>
<navigator class="couponItem-btn" hover-class="none" :url="'/pages/giftPack/details?id=' + item.id">
立即使用
</navigator>
</view>
<view class="couponItem-cont-text" v-if="item.couponShow">
<rich-text :nodes="item.remark"></rich-text>
</view>
</view>
</view>
</block>
<!-- 列表为空 -->
<view class="campusTips" v-else>
<view class="campusTips-cont">
<image src="/static/img/giftPack-null.png"></image>
<view>可使用的卡券暂时没有啦~</view>
<navigator hover-class="none" url="/pages/giftPack/myCoupon" class="campusTips-cont-go">我的优惠券</navigator>
</view>
</view>
</block>
</view>
<!-- 按钮 -->
<view class="campusBtn">
<navigator url="/pages/giftPack/index" hover-class="none" class="campusBtn-go active">
<image class="campusBtn-iocn" src="/static/img/giftPack-user00_active.png" mode="widthFix"></image>
<view class="campusBtn-name">
活动首页
</view>
</navigator>
<navigator url="/pages/giftPack/user" hover-class="none" class="campusBtn-go">
<image class="campusBtn-iocn" src="/static/img/giftPack-user01.png" mode="widthFix"></image>
<view class="campusBtn-name">
个人中心
</view>
</navigator>
</view>
</view>
</template>
<script>
import { index, coupon } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
giftPackArr : [],
adverts : [],
couponArr : [],
numbers : '',
count : '',
//Tab列表
tabList : [
{ title : "可兑换", used: 0 },
{ title : "已兑换", used: 1 }
],
tabType : 0, //卡券状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
// 获取首页数据
this.indexInfo();
},
methods: {
// 首页数据
indexInfo() {
if(this.tabType == 0) {
// 获取首页数据
index().then(res=>{
var listData = res.categories
this.numbers = res.numbers
this.count = res.coupons_count
this.adverts = res.adverts
for(let val in listData){
listData[val].schemesShow = false
}
this.giftPackArr = listData
}).catch(err=>{})
} else {
// 获取优惠券数据
coupon().then(res=>{
var listData = res.data
for(let val in listData){
listData[val].couponShow = false
}
this.couponArr = listData
console.log(this.couponArr)
}).catch(err=>{})
}
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url
if(uni.getStorageSync("token")) {
uni.navigateTo({
url: pageUrl
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/giftPack/signin'
})
},
// tabs 选项卡
orderTab(e){
let state = e.currentTarget.dataset.state
this.tabType = state
// 获取首页数据
this.indexInfo();
},
// 可兑换信息展开
moreClick(index) {
this.giftPackArr[index].schemesShow = !this.giftPackArr[index].schemesShow
},
// 已兑换细信息展开
moreCoupon(index) {
this.couponArr[index].couponShow = !this.couponArr[index].couponShow
},
}
}
</script>
<style lang="scss" scoped>
.content {
background: linear-gradient(to bottom, #fdf5cc, #cbaf7f);
padding-bottom: 40rpx;
height: 100vh;
overflow-y: scroll;
box-sizing: border-box
}
.content-border {
border-bottom: 130rpx transparent solid;
}
// banner
.campusBanner {
width: 100%;
}
// 推荐
.recommend {
overflow: hidden;
margin-top: -60rpx;
padding: 0 30rpx;
box-sizing: border-box;
.recommend-label {
text-align: center;
width: calc(50% - 20rpx);
float: left;
margin: 0 10rpx 30rpx;
.recommend-label-img {
width: 150rpx;
height: 150rpx;
margin: 0 auto 10rpx;
background: linear-gradient(to bottom, #293350, #484e74);
box-shadow: 0px 8px 6px rgba(249,228,129,.5);
border-radius: 50%;
box-sizing: border-box;
image {
width: 80rpx;
height: 80rpx;
margin: 35rpx;
}
}
.recommend-label-text {
text {
display: block;
font-size: 30rpx;
}
}
}
}
// 列表
.film {
width: 100%;
padding: 10rpx 30rpx 20rpx;
box-sizing: border-box;
}
.filmTitle {
background: linear-gradient(to right, #feefce, #fbe9c0, #e8d19b);
line-height: 80rpx;
box-shadow: -4px 0 10px rgba(134,97,33,.2);
text-align: center;
border-radius: 10rpx 10rpx 0 0;
color: #a47d53;
margin: 0 20rpx;
}
.filmList {
position: relative;
background: linear-gradient(to right, #494e75, #27314d);
box-shadow: 0px 6px 10px rgba(134,97,33,.5);
border-radius: 10rpx;
padding: 50rpx 30rpx 30rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
overflow: hidden;
&:last-child {
margin-bottom: 0;
}
.filmList-tag {
transform: rotate(45deg);
position: absolute;
padding: 10px 0;
right: -33px;
top: -10px;
width: 150px;
background: red;
.filmList-tag-text {
position: absolute;
color: #FFFFFF;
right: 20px;
text-align: center;
top: 2px;
font-size: 12px;;
transform:rotate(-360deg);
}
}
.filmList-more {
font-size: 26rpx;
text-align: left;
color: #fce2ae;
margin-top: 30rpx;
line-height: 40rpx;
.filmList-more-icon {
width: 34rpx;
height: 34rpx;
vertical-align: -6rpx;
margin-left: 5rpx;
transition: .2s;
&.active {
transform:rotate(-180deg);
}
}
}
.filmList-show {
font-size: 24rpx;
border-radius: 10rpx;
background-color: rgba(255,255,255,.1);
padding: 20rpx;
box-sizing: border-box;
margin-top: 20rpx;
opacity: .9;
color: #fce2ae;
text-align: justify;
line-height: 42rpx;
text {
display: block;
}
}
.filmList-top {
display: flex;
margin-bottom: 10rpx;
.filmList-top-name {
width: calc(100% - 140rpx);
margin-right: 20rpx;
color: #fce2ae;
font-size: 32rpx;
margin-top: 10rpx;
text {
display: block;
font-size: 25rpx;
margin-top: 15rpx;
}
}
.filmList-top-price {
position: relative;
background: linear-gradient(to right, #d3ad68, #cda65f);
box-shadow: 0px 2px 10px rgba(249,228,129,.5);
width: 120rpx;
height: 120rpx;
border-radius: 50%;
color: #FFFFFF;
text-align: center;
padding-top: 20rpx;
font-size: 30rpx;
box-sizing: border-box;
&.active {
background: linear-gradient(to right, #a1a1a1, #a1a1a1);
}
text {
display: block;
text-shadow: 0px 6px 10px rgba(134,97,33,.5);
}
.filmList-tag{
position: absolute;
background: #ff0000;
color: white;
font-size: 20rpx;
top: -10%;
left: 20%;
width: 120rpx;
padding: 0 10rpx;
line-height: 40rpx;
border-radius: 15rpx;
transform: scale(0.58)
}
}
}
.filmList-text {
font-size: 20rpx;
color: #c1c1c1;
// margin-left: -70rpx;
text {
display: block;
// transform: scale(0.8)
}
}
}
// 已兑换
.coupon {
padding: 0 30rpx 10rpx;
box-sizing: border-box;
.couponItem {
margin-bottom: 30rpx;
.couponItem-cont {
background-color: #caa668;
border-radius: 10rpx;
position: relative;
height: 140rpx;
overflow: hidden;
.couponItem-top {
padding: 30rpx 20rpx;
box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
height: 100%;
background-image: linear-gradient(to right, #fffbf5, #f2e2cc);
width: calc(100% - 160rpx);
display: flex;
border-radius: 0 15rpx 15rpx 0;
.couponItem-cont-number {
width: 100rpx;
line-height: 84rpx;
color: #a85920;
text {
font-size: 54rpx;
}
}
.couponItem-cont-name {
color: #72411f;
padding-left: 40rpx;
box-sizing: border-box;
width: calc(100% - 100rpx);
position: relative;
&::after {
position: absolute;
content: '';
left: 13rpx;
top: 10%;
background-color: #ecd5c1;
width: 2rpx;
height: 80%;
}
.couponItem-cont-title {
font-size: 30rpx;
}
.couponItem-cont-show {
display: flex;
font-size: 26rpx;
padding-top: 13rpx;
.couponItem-cont-icon {
width: 34rpx;
height: 34rpx;
vertical-align: -6rpx;
margin-left: 5rpx;
transition: .2s;
&.active {
transform:rotate(-180deg);
}
}
}
}
}
.couponItem-btn {
line-height: 140rpx;
position: absolute;
right: 0;
top: 0;
width: 160rpx;
height: 100%;
text-align: center;
color: #FFFFFF;
font-size: 30rpx;
}
}
.couponItem-cont-text {
background-image: linear-gradient(-20deg, #fffbf5, #fbefdf);
padding: 30rpx;
box-sizing: border-box;
color: #bc8863;
line-height: 48rpx;
font-size: 24rpx;
margin-top: -4rpx;
text-align: justify;
border-radius: 0 0 15rpx 15rpx;
}
}
}
// 按钮
.campusBtn {
text-align: center;
color: #FFFFFF;
background-color: #fff;
display: flex;
position: fixed;
width: 100%;
height: 130rpx;
z-index: 999;
left: 0;
bottom: 0;
font-size: 28rpx;
.campusBtn-go {
flex: 2;
padding-top: 20rpx;
.campusBtn-iocn {
width: 44rpx;
}
.campusBtn-name {
color: #abaeb2;
}
&.active .campusBtn-name {
color: #2b3452;
}
}
}
// tab
.indexTab {
display: flex;
padding-bottom: 40rpx;
.indexTab-item {
text-align: center;
font-size: 34rpx;
flex: 2;
padding-bottom: 20rpx;
position: relative;
color: #8c919f;
&::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
width: 40rpx;
height: 8rpx;
background-color: transparent;
border-radius: 40rpx;
}
&.active::after {
background-color: #27314d;
}
&.active {
color: #27314d;
font-weight: 600;
}
.indexTab-title,
.indexTab-number {
display: inline-block;
}
}
}
.campusTips {
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;
}
}
}

View File

@@ -0,0 +1,163 @@
<template>
<view class="content">
<view class="title">
积分记录
</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">余额19999</div>
<div class="item-cont-time">{{item.created_at}}</div>
</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>
</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>
<script>
import { logs } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
accounts : '', // 账户列表
page: {
has_more: false
}, // 下一页
lodingStats: false // 数据加载完渲染
}
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
// 获取账变记录
this.accountInfo();
},
methods: {
// 账变记录
accountInfo(page) {
logs({
type : 'gold',
page : page,
channel : 'all'
}).then(res=>{
console.log(res.data)
let newStores = this.accounts,
newData = []
if(page == 1 || page == undefined) newStores = []
newData = newStores.concat(res.data)
this.accounts = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
console.log(this.accounts)
})
},
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 30rpx;
box-sizing: border-box;
}
.title {
font-size: 36rpx;
font-weight: 600;
}
.list {
margin-top: 30rpx;
.item {
background-color: #fff;
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.item-img {
width: 54rpx;
margin-top: 25rpx;
}
.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;
}
}
}
}
}
.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;
}
}
}
</style>

View File

@@ -0,0 +1,542 @@
<template>
<view class="content">
<view class="user">
<image src="/static/img/giftPackCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加此活动
</view>
<!-- 我的卡券 -->
<view class="campusCont">
<!-- 卡券tab -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : stateType == item.used}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-index="(index)" :data-state="(item.used)">
{{ item.title }}
</view>
</view>
<!-- 卡券列表 -->
<view class="coupon" v-if="coupons.length > 0" :class="{active : coupons.length < 1}">
<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>
<view class="couponItem-cont-name">
<view class="couponItem-cont-title">
{{item.name}}
</view>
<view class="couponItem-cont-show" @click="moreCoupon(index)">
详细信息<image src="/static/icon/giftPack-icon.png" class="couponItem-cont-icon" :class="{active: item.couponShow }" mode="widthFix"></image>
</view>
</view>
</view>
<navigator v-if="item.status == 0" class="couponItem-btn" hover-class="none" :url="'/pages/giftPack/details?id=' + item.id">
立即使用
</navigator>
<view v-else-if="item.status == 1" class="couponItem-btn">
已使用
</view>
<view v-else class="couponItem-btn">
已过期
</view>
</view>
<view class="couponItem-cont-text" v-if="item.couponShow">
<rich-text :nodes="item.remark"></rich-text>
</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>
<!-- 漂浮窗 -->
<view class="indexFloat" @click="followBtn">
<image src="/static/img/subscribe.jpg" mode="aspectFill" class="indexFloat-animation"></image>
<view class="indexFloat-text">
<!-- <text>可查看大图</text> -->
<text>关注小程序</text>
</view>
</view>
<!-- 关注公众号弹出 -->
<view class="followBack" :class="{active : followState}"></view>
<view class="followPop" :class="{active : followState}">
<image class="followPop-img" src="/static/img/subscribe.jpg" mode="widthFix"></image>
<view class="followPop-text">
<text>长按识别图中二维码</text>
<image src="/static/img/follow_tips.png" mode="aspectFill"></image>
</view>
<view class="followPop-tips">
本时生活平台优惠活动
</view>
</view>
<image class="followPop-clos" :class="{active : followState}" src="/static/icon/add.png" mode="aspectFill" @click="followBtn"></image>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/user'
import { coupon } from '@/apis/interfaces/giftPack'
export default {
data() {
return {
userTel : '', //用户者手机号
coupons : [], //优惠券列表
//优惠券Tab列表
couponLabel : [
{ title : "未使用", used: 0 },
{ title : "已使用", used: 1 },
{ title : "已过期", used: 2 }
],
stateType : '0', //卡券状态
type : '', //卡券来源
followState : false //二维码弹出状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 获取用户信息
index().then(res => {
this.userTel = res.info.username
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
});
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-本时大礼包新活动
getApp().globalData.envType = 'giftPEnv'
// 获取列表
this.couponInfo();
},
methods: {
// 卡券列表
couponInfo() {
coupon({
status: this.stateType
}).then(res=>{
var listData = res.data
for(let val in listData){
listData[val].couponShow = false
}
this.coupons = listData
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/giftPack/signin'
});
}
}
});
}
})
},
// tabs 选项卡
orderTab(e){
this.stateType = e.currentTarget.dataset.state
// 获取卡权益
this.couponInfo()
},
// 已兑换细信息展开
moreCoupon(index) {
this.coupons[index].couponShow = !this.coupons[index].couponShow
},
// 优惠券跳转详情
couponUrl(e) {
let newId = e.currentTarget.dataset.id
uni.navigateTo({
url: '/pages/giftPack/details?id=' + newId
})
},
// 公众号展示
followBtn() {
this.followState = !this.followState
}
}
}
</script>
<style lang="scss" scoped>
/* 用户信息 */
.user {
width: 100%;
background: #fff;
font-size: 28rpx;
padding: 20rpx;
box-sizing: border-box;
color: #a85920;
display: flex;
line-height: 48rpx;
}
.user text {
font-weight: 600;
padding: 0 10rpx;
}
.user image {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
.campusCont {
padding: 30rpx;
box-sizing: border-box;
}
.campusCont.active {
border-bottom: 140rpx solid transparent;
}
.couponTab{
display: flex;
}
.couponTab-label {
flex: 3;
text-align: center;
font-size: 30rpx;
position: relative;
padding-bottom: 20rpx;
&::after {
position: absolute;
content: '';
left: calc(50% - 20rpx);
bottom: 0;
width: 40rpx;
height: 8rpx;
background-color: transparent;
border-radius: 40rpx;
}
&.active {
color: #a85920;
font-weight: 600;
}
&.active::after {
background-color: #a85920;
}
}
.couponTab-label view {
font-size: 24rpx;
margin-top: 6rpx;
}
.coupon {
padding-bottom: 10rpx;
box-sizing: border-box;
}
/* 漂浮弹出层 */
.indexFloat {
position: fixed;
right: 20rpx;
bottom: 180rpx;
z-index: 99;
}
.indexFloat-text {
height: 40rpx;
overflow: hidden;
color: #000000;
}
.indexFloat-text text {
line-height: 40rpx;
display: block;
font-size: 24rpx;
}
.indexFloat-animation {
width: 130rpx;
height: 130rpx;
animation: shake 3s linear infinite;
}
@keyframes shake {
70%, 80% {
transform: rotate(7deg);
}
75% {
transform: rotate(-7deg);
}
65%,
85% {
transform: rotate(0);
}
}
/* 关注公众号弹出 */
.followBack {
position: fixed;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,.7);
left: 0;
top: 0;
z-index: 1000;
display: none;
}
.followBack.active {
display: block;
}
.followPop {
position: fixed;
z-index: 1001;
height: 760rpx;
left: 15%;
right: 15%;
top: 300rpx;
background-color: #ffffff;
border-radius: 20rpx;
text-align: center;
overflow: hidden;
display: none;
}
.followPop.active {
display: block;
}
.followPop-img {
width: 70%;
margin: 60rpx 0 50rpx;
}
.followPop-text {
color: #7d7d7d;
font-size: 32rpx;
position: relative;
}
.followPop-text::after,
.followPop-text::before {
position: absolute;
content: '';
top: 25rpx;
width: 60rpx;
height: 2rpx;
background-color: #cfcfcf;
}
.followPop-text::after {
left: 30rpx;
}
.followPop-text::before {
right: 30rpx;
}
.followPop-text image {
width: 120rpx;
height: 120rpx;
margin: 10rpx auto 20rpx;
display: block;
}
.followPop-tips {
background-color: #e1e5ec;
line-height: 90rpx;
color: #7f8487;
}
.followPop-clos {
position: fixed;
top: 1100rpx;
left: calc(50% - 25rpx);
width: 50rpx;
height: 50rpx;
z-index: 1001;
display: none;
transform: rotate(45deg);
}
.followPop-clos.active {
display: block;
}
// 优惠券
.coupon {
margin-top: 40rpx;
.couponItem {
margin-bottom: 30rpx;
.couponItem-cont {
background-color: #caa668;
border-radius: 10rpx;
position: relative;
height: 140rpx;
overflow: hidden;
.couponItem-top {
padding: 30rpx 20rpx;
box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
height: 100%;
background-image: linear-gradient(to right, #fffbf5, #f2e2cc);
width: calc(100% - 160rpx);
display: flex;
border-radius: 0 15rpx 15rpx 0;
.couponItem-cont-number {
width: 100rpx;
line-height: 84rpx;
color: #a85920;
text {
font-size: 54rpx;
}
}
.couponItem-cont-name {
color: #72411f;
padding-left: 40rpx;
box-sizing: border-box;
width: calc(100% - 100rpx);
position: relative;
&::after {
position: absolute;
content: '';
left: 13rpx;
top: 10%;
background-color: #ecd5c1;
width: 2rpx;
height: 80%;
}
.couponItem-cont-title {
font-size: 30rpx;
}
.couponItem-cont-show {
display: flex;
font-size: 26rpx;
padding-top: 13rpx;
.couponItem-cont-icon {
width: 32rpx;
margin-left: 5rpx;
}
}
}
}
.couponItem-btn {
line-height: 140rpx;
position: absolute;
right: 0;
top: 0;
width: 160rpx;
height: 100%;
text-align: center;
color: #FFFFFF;
font-size: 30rpx;
}
}
.couponItem-cont-text {
background-image: linear-gradient(-20deg, #fffbf5, #fbefdf);
padding: 30rpx;
box-sizing: border-box;
color: #bc8863;
line-height: 48rpx;
font-size: 24rpx;
margin-top: -4rpx;
text-align: justify;
border-radius: 0 0 15rpx 15rpx;
}
.couponItem-cont-show {
display: flex;
font-size: 26rpx;
padding-top: 13rpx;
.couponItem-cont-icon {
width: 34rpx;
height: 34rpx;
vertical-align: -6rpx;
margin-left: 5rpx;
transition: .2s;
&.active {
transform:rotate(-180deg);
}
}
}
&.active .couponItem-cont {
background: #c1c1c1;
}
&.active .couponItem-top {
background-image: linear-gradient(to right, #d9d9d9, #d9d9d9);
}
&.active .couponItem-cont-number,
&.active .couponItem-cont-title,
&.active .couponItem-cont-show {
color: #7e7e7e !important;
}
&.active .couponItem-cont-icon {
filter: grayscale(100%);
}
&.active .couponItem-cont-text{
background-image: linear-gradient(to right, #eaeaea, #eaeaea);
color: #7e7e7e !important;
}
}
}
.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;
}
}
}
</style>

View File

@@ -0,0 +1,232 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<image src="/static/img/campus_logo.jpg" mode="aspectFill"></image>
<view class="title">身份验证</view>
</view>
<image class="cover" src="/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<button class="campus-form-btn" form-type="submit">设置新密码</button>
</form>
</view>
</view>
</template>
<script>
import { send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]||16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || ''
auth({
mobile: mobileNo,
code: code,
type: 'reset_password'
}).then(res => {
this.$store.commit('setToken', res.token)
uni.redirectTo({
url: '/pages/giftPack/setPassword'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
border-radius: 50%;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,239 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campus_logo.jpg" mode="aspectFill"></image>
<view class="title">月兑用户注册</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="submitRegister">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue"
name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请输入密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请确认密码" name="password_confirmation"></input>
</view>
<button class="campus-form-btn" form-type="submit">注册</button>
</form>
</view>
</view>
</template>
<script>
import { send, register } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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({
title : err.message,
icon :'none',
duration: 2000
})
})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
submitRegister(e){
let formValue = e.detail.value
register({
mobile : formValue.mobile,
password : formValue.password,
password_confirmation : formValue.password_confirmation,
code : this.code,
parent_id : 0
}).then(res => {
this.$store.commit('setToken', res.token)
uni.showModal({
title : "提示",
content : "注册成功",
showCancel : false,
confirmText : "确定",
success : modalRes => {
if(modalRes.confirm){
uni.reLaunch({
url: '/pages/giftPack/index'
})
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
border-radius: 50%;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,170 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campus_logo.jpg" mode="aspectFill"></image>
<view class="title">设置新密码</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="设置新的登录密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="确认新的登录密码" name="newpassword"></input>
</view>
<button class="campus-form-btn" form-type="submit">找回</button>
</form>
</view>
</view>
</template>
<script>
import { passSetup } from '@/apis/interfaces/auth'
export default {
data() {
return {
}
},
methods: {
// 立即登录
forgetlogin(e){
let newPass = e.detail.value.newpassword || '',
password = e.detail.value.password || ''
passSetup({
password: password,
password_confirmation: newPass
}).then(res => {
uni.showToast({
title: "密码重置成功",
icon : 'none'
})
uni.reLaunch({
url: '/pages/giftPack/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
border-radius: 50%;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,260 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<image src="@/static/img/campus_logo.jpg" mode="aspectFill"></image>
<view class="title">月兑活动登录</view>
</view>
<image class="cover" src="@/static/img/campusLogin_back_01.png" mode="aspectFill"></image>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/campus_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code" v-if="!passwordLogin">
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs" v-else>
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="password" placeholder="请输入登录密码" name="password"></input>
</view>
<view class="resPassword">
<navigator url="password">忘记密码</navigator>
</view>
<button class="campus-form-btn" form-type="submit">登录</button>
</form>
<view class="login-box">
<view @click="onCutLogin">{{passwordLogin ? '验证码登录': '密码登录'}}</view>
<navigator url="register">快速注册</navigator>
</view>
</view>
</view>
</template>
<script>
import { send, auth, passlogin } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
passwordLogin: true, // 登录方式
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]|16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || '',
password = e.detail.value.password || '',
loginFunction
if(this.passwordLogin){
loginFunction = passlogin({
mobile : mobileNo,
password: password
})
}else{
loginFunction = auth({
mobile: mobileNo,
code: code,
type: ''
})
}
loginFunction.then(res => {
this.$store.commit('setToken', res.token)
uni.reLaunch({
url: '/pages/giftPack/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 90rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
navigator{
display: inline-block;
}
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
border-radius: 50%;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,361 @@
<template>
<view class="content">
<view class="content-border">
<view class="user">
<view class="userTop">
<view class="userTop-name" v-if="userData.info"><text>用户</text>{{userData.info.username}}</view>
<view class="userTop-text">感谢您参加本事礼包活动</view>
</view>
<view class="userItem">
<!-- <view class="userItem-label">
<view class="userItem-label-number">
<image class="userItem-label-img" src="@/static/img/giftPack-img02.png" mode="widthFix"></image><text>23</text>
</view>
<view class="userItem-label-text">总余额</view>
</view> -->
<view class="userItem-label">
<view class="userItem-label-number" v-if="userData.gold">
<image class="userItem-label-img" src="@/static/img/giftPack-img03.png" mode="widthFix"></image><text>{{userData.gold.balance}}</text>
</view>
<view class="userItem-label-text">可用余额</view>
</view>
<view class="userItem-label">
<view class="userItem-label-number" v-if="userData.gold">
<image class="userItem-label-img" src="@/static/img/giftPack-img04.png" mode="widthFix"></image><text>{{userData.gold.overdue}}</text>
</view>
<view class="userItem-label-text">已过期</view>
</view>
</view>
<view class="userList" @click="userNav('/pages/giftPack/logs')">
<image class="userList-img" src="@/static/img/giftPack-img05.png" mode="widthFix"></image>
<view class="userList-text">查看积分详细记录</view>
</view>
<view class="userTips">
<view class="userTips-left">
积分账户
</view>
<view class="userTips-right">
本时生活<text>·</text>礼包活动
</view>
</view>
<image class="userBack" src="@/static/img/giftPack-img01.png" mode="widthFix"></image>
</view>
<view class="userCoupon" @click="userNav('/pages/giftPack/myCoupon')">
<image class="userCoupon-img" src="@/static/img/giftPack-img06.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">
其他功能
</view>
<view class="userTool-item" @click="userNav('/pages/giftPack/setPassword')">
<image class="userTool-img" src="@/static/img/giftPack-img08.png" mode="widthFix"></image>
<view class="userTool-cont">
<view class="userTool-name">修改密码</view>
<image class="userTool-arrow" src="@/static/icon/rightsArrow.png" mode="widthFix"></image>
</view>
</view>
<view class="userTool-item" @click="delStorage">
<image class="userTool-img" src="@/static/img/giftPack-img07.png" mode="widthFix"></image>
<view class="userTool-cont">
<view class="userTool-name">退出登录</view>
<image class="userTool-arrow" src="@/static/icon/rightsArrow.png" mode="widthFix"></image>
</view>
</view>
</view>
</view>
<!-- 按钮 -->
<view class="campusBtn">
<navigator url="/pages/giftPack/index" hover-class="none" class="campusBtn-go">
<image class="campusBtn-iocn" src="/static/img/giftPack-user00.png" mode="widthFix"></image>
<view class="campusBtn-name">
活动首页
</view>
</navigator>
<navigator url="/pages/giftPack/user" hover-class="none" class="campusBtn-go active">
<image class="campusBtn-iocn" src="/static/img/giftPack-user01_active.png" mode="widthFix"></image>
<view class="campusBtn-name">
个人中心
</view>
</navigator>
</view>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/user'
export default {
data() {
return {
userData: '', //用户
}
},
// 生命周期函数--监听页面加载
onLoad(options) {},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-月兑活动
getApp().globalData.envType = 'giftPEnv'
if(uni.getStorageSync("token")) {
// 获取用户接口
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'
});
}
}
});
}
});
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url
if(uni.getStorageSync("token")) {
uni.navigateTo({
url: pageUrl
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/giftPack/signin'
})
},
// 退出登录
delStorage() {
uni.clearStorage()
uni.navigateTo({
url:'/pages/giftPack/signin'
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 80rpx 30rpx 30rpx;
box-sizing: border-box;
}
.content-border {
border-bottom: 130rpx transparent solid;
}
.user {
background-image: linear-gradient(110deg, #ecdec4, #f6efe2);
border-radius: 10rpx;
padding: 30rpx;
box-sizing: border-box;
position: relative;
.userBack {
position: absolute;
right: 20rpx;
top: -60rpx;
width: 190rpx;
}
.userTop {
color: #80622a;
.userTop-name {
display: flex;
font-size: 46rpx;
line-height: 54rpx;
font-weight: 600;
text {
font-size: 28rpx;
padding-right: 20rpx;
padding-top: 6rpx;
}
}
.userTop-text {
font-size: 26rpx;
color: #bc903d;
}
}
.userItem {
margin: 30rpx 0;
background-color: #f7f1e5;
border-radius: 10rpx;
display: flex;
padding: 30rpx 0;
.userItem-label {
flex: 2;
text-align: center;
.userItem-label-number {
.userItem-label-img {
width: 40rpx;
margin-right: 15rpx;
display: inline-block;
vertical-align: -4rpx;
}
text {
font-weight: 600;
font-size: 40rpx;
}
}
.userItem-label-text {
color: #8f6d2f;
font-size: 26rpx;
padding-top: 10rpx;
}
}
}
.userList {
background-color: #f7f1e5;
border-radius: 10rpx;
display: flex;
padding: 30rpx 20rpx;
line-height: 60rpx;
box-sizing: border-box;
font-size: 32rpx;
.userList-img {
width: 60rpx;
margin-right: 20rpx;
color: #000000;
}
}
.userTips {
width: 100%;
color: #cca762;
display: flex;
font-size: 28rpx;
margin-top: 30rpx;
line-height: 30rpx;
.userTips-left {
flex: 1;
}
.userTips-right {
text {
font-size: 32rpx;
font-weight: 600;
padding: 0 8rpx;
}
}
}
}
.userCoupon {
background-color: #fff;
border-radius: 10rpx;
padding: 30rpx 15rpx 30rpx 30rpx;
margin: 30rpx 0;
box-sizing: border-box;
display: flex;
.userCoupon-img {
width: 60rpx;
margin-right: 20rpx;
}
.userCoupon-cont {
width: calc(100% - 80rpx);
line-height: 58rpx;
display: flex;
.userCoupon-name {
flex: 1;
font-size: 32rpx;
font-weight: 600;
}
.userCoupon-arrow {
width: 44rpx;
margin-top: 8rpx;
}
}
}
.userTool {
background-color: #fff;
border-radius: 10rpx;
padding: 30rpx 15rpx 30rpx 30rpx;
margin: 30rpx 0;
box-sizing: border-box;
.userTool-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 40rpx;
}
.userTool-item {
display: flex;
border-bottom: 2rpx solid #f8f8f8;
padding-bottom: 40rpx;
margin-bottom: 40rpx;
&:last-child {
padding-bottom: 10rpx;
margin-bottom: 0;
border: none;
}
.userTool-img {
width: 40rpx;
margin-right: 20rpx;
margin-top: 6rpx;
}
.userTool-cont {
width: calc(100% - 60rpx);
line-height: 50rpx;
display: flex;
.userTool-name {
flex: 1;
font-size: 32rpx;
}
.userTool-arrow {
width: 44rpx;
margin-top: 8rpx;
}
}
}
}
// 按钮
.campusBtn {
text-align: center;
color: #FFFFFF;
background-color: #fff;
display: flex;
position: fixed;
width: 100%;
height: 130rpx;
z-index: 999;
left: 0;
bottom: 0;
font-size: 28rpx;
.campusBtn-go {
flex: 2;
padding-top: 20rpx;
.campusBtn-iocn {
width: 44rpx;
}
.campusBtn-name {
color: #abaeb2;
}
&.active .campusBtn-name {
color: #2b3452;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,668 @@
<template>
<view>
<!-- 按钮 -->
<view class="newrightsBtn" @tap="payment">
<view class="rightsBtn-text">
<view class="rightsBtn-text-num">{{ rightData.num }}件商品 </view>
<view>实付<text>{{ rightData.total }}</text></view>
</view>
<button :disabled="disabled">立即购买</button>
</view>
<!-- 卡券 -->
<view style="padding-bottom: 90px">
<view class="cont">
<view class="contBack">
<image class="classBack" src="https://lifetest.ysd-bs.com/storage/materials/2021/08/09/class_back_02.png" mode="scaleToFill"></image>
<view class="classCircle"></view>
<view class="rightsCont">
<scroll-view scroll-x class="welfareCont-top" scroll-with-animation>
<view class="welfareCont-list-img" v-for="(item, index) in rightData.detail.logos" :key="index">
<image :src="item" mode="aspectFill"></image>
</view>
</scroll-view>
<view class="nowrap rightsCont-btn">
{{ rightData.detail.four_title }}
</view>
</view>
</view>
</view>
<!-- 数量 -->
<view class="rightsNumber">
<image class="rightsGoods-img" :src="rightData.detail.goods_cover" mode="aspectFill"></image>
<view class="rightsGoods">
<view class="nowrap rightsGoods-text">
{{ rightData.detail.five_title }}
</view>
<view class="rightsGoods-price">
<view class="rightsGoods-number"><text></text>{{ rightData.detail.price }}</view>
<view class="rightsAdd">
<view class="rightsAdd-btn rightsAdd-remove" :class="{active : rightData.num != 1}" @click="goodsNumber('remove')">-</view>
<input class="rightsAdd-input" :data-num="rightData.num" :value="rightData.num" type="number" disabled=""></input>
<view class="rightsAdd-btn rightsAdd-plus" @click="goodsNumber('plus')">+</view>
</view>
</view>
</view>
</view>
<!-- 收货地址 -->
<block v-if="buyWay.platformCp[buyWay.platIndex]">
<view class="rightsList" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<block v-if="rightData.detail.type == 'physical'">
<view class="rightsLabel">
<view class="rightsLabel-left">提交方式</view>
<view class="rightsLabel-right rightsLabel-range">
<picker :value="buyWay.platIndex" :range-key="'name'" :range="buyWay.platformCp" range-key="name" @change="platBind">
<view class="tabs-text">
{{ buyWay.platformCp[buyWay.platIndex].name }}
</view>
</picker>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</view>
<view class="rightsLabel rightsLabel-address" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<image class="rightsLabel-icon" src="/static/img/new_rightsAddress.png"></image>
<block v-if="rightData.addressSee != ''">
<view class="rightsLabel-right" @tap="addressTap">
<view class="rightsLabel-address-text">
<view class="rightsLabel-address-name">{{ rightData.addressSee.name }}<view class="rightsLabel-address-tel">{{ rightData.addressSee.mobile }}</view></view>
<text class="nowrap">{{ rightData.addressSee.all_address }}</text>
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</view>
</block>
<block v-else>
<navigator class="rightsLabel-right" hover-class="none" url="/pages/address_form/address_form?type=Add">
<view class="rightsLabel-address-text" style="line-height: 90rpx;">
添加收货地址
</view>
<image class="rightsLabel-row" src="/static/icon/rightsArrow.png"></image>
</navigator>
</block>
</view>
<view class="rightsLabel" v-if="buyWay.platformCp[buyWay.platIndex].name == '快递'">
<view class="rightsLabel-left">快递运费</view>
<view class="rightsLabel-right rightsLabel-freight">{{ rightData.freight }}</view>
</view>
</block>
</view>
</block>
<!-- 购买须知 -->
<view class="notice">
<view class="noticeTitle" @click="noticeTap">
<view class="noticeTitle-flex">
<image class="noticeTitle-img" src="/static/icon/notice_icon.png"></image>
购买前请仔细阅读使用须知内容介绍
</view>
<image class="noticeTitle-row" :class="{active : notice.noticeShow}" src="/static/icon/rightsArrow.png"></image>
</view>
<view class="noticeText" :class="{active : notice.noticeShow}">
<view class="noticeText-top">购买须知</view>
<view class="noticeText-cont" v-if="notice.remark">
<rich-text :nodes="notice.remark"></rich-text>
</view>
<view class="noticeText-top">内容介绍</view>
<view class="noticeText-cont" v-if="notice.content">
<rich-text :nodes="notice.content"></rich-text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { buy, buySubmit } from '@/apis/interfaces/oil'
export default {
data() {
return {
rightData: {
detail : '', // 权益内容
rightId : '', // 权益id
addressSee : '', // 收货地址
num : 1, // 购买数量
moreAmount : '', // 产品总金额
freight : '', // 运费
total : '' // 总金额
},
notice : {
remark : '', // 购买须知
content : '', // 内容介绍
noticeShow : true // 购买须知状态
},
buyWay : {
platformCp : [], // 选择提交数组
platIndex : 0, // 选择提交方式下标
isdeliver : -1 // 选择提交方式
},
address : {
allAddress : [], // 收货地址列表
addressShow : false // 地址显示状态
},
disabled : false, //购买按钮状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.rightData.rightId = options.id
// this.code = options.code || ''
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-中石油活动
getApp().globalData.envType = 'oilEnv'
// 获取详情
this.rightsInfo();
},
methods: {
// 详情
rightsInfo() {
buy({activity_petro_id: this.rightData.rightId, qty: this.rightData.num}).then(res => {
let obj = res.detail.express
let arr = new Array
arr = Object.keys(obj).map(val=>{
return { ...obj[val], ...{key: val} }
})
if(this.buyWay.isdeliver == -1){
if(res.detail.type == 'physical') {
this.buyWay.isdeliver = res.detail.def_get
}
if(res.detail.type == 'virtual') this.buyWay.isdeliver = 1
}
this.rightData.detail = res.detail
this.rightData.moreAmount = res.amount
this.rightData.total = res.total
this.buyWay.platformCp = arr
this.rightData.freight = res.freight
this.rightData.addressSee = res.address
this.address.allAddress = res.all_address
this.notice.remark = res.detail.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.notice.content = res.detail.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
// 商品数量加减
goodsNumber(e){
let num = this.rightData.num
if (e == 'plus'){
num ++;
}else{
if (num > 1){
num --;
}else{
uni.showToast({
title : '商品数量不能小于1',
icon : 'none'
})
}
}
this.rightData.num = num
// 获取详情
this.rightsInfo()
},
// 须知展开收起状态
noticeTap() {
this.notice.noticeShow = !this.notice.noticeShow
},
// 收银台跳转
payment() {
if(this.buyWay.isdeliver.length == 0) this.buyWay.isdeliver = this.rightData.detail.def_get
buySubmit({activity_petro_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=oil' + "&activity_type=right" + '&price=' + this.rightData.moreAmount
})
}).catch(err => {
uni.showToast({
title : err.message,
icon : 'none'
})
});
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #FFFFFF;
}
/* 权益内容 */
.cont {
width: 100%;
overflow: hidden;
.contBack {
position: relative;
width: 200%;
height: 340rpx;
left: -50%;
text-align: center;
background: #000000;
border-radius: 0 0 100% 100%;
overflow: hidden;
.classBack {
position: absolute;
left: 28%;
right: 30%;
width: 44%;
top: 40rpx;
}
}
.classCircle::after,
.contBack::before {
position: absolute;
border-radius: 50%;
content: '';
z-index: 1;
background-color: rgba(255,255,255,.1);
}
.classCircle::after {
left: 20%;
top: -20rpx;
width: 260rpx;
height: 260rpx;
}
.contBack::before {
right: 20%;
top: 55%;
width: 300rpx;
height: 300rpx;
}
.rightsCont {
position: absolute;
z-index: 3;
left: calc(28% - 2rpx);
right: calc(30% - 2rpx);
width: calc(44% + 4rpx);
top: 50rpx;
.welfareCont-top{
white-space: nowrap;
flex-direction: row;
align-items: center;
justify-content: space-around;
width: 100%;
padding: 0 10rpx;
box-sizing: border-box;
margin: 50rpx 0 20rpx;
height: 120rpx;
.welfareCont-list-img {
border-radius: 50%;
width: 120rpx;
height: 120rpx;
display: inline-block;
margin: 0 15rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
}
.rightsCont-btn {
background: rgba(255, 255, 0255, .4);
width: 100%;
line-height: 70rpx;
font-size: 40rpx;
font-weight: 600;
color: #000000;
padding: 0 20rpx;
box-sizing: border-box;
}
}
}
// 数量
.rightsNumber {
background-color: #ffffff;
position: relative;
padding: 30rpx 40rpx;
box-sizing: border-box;
.rightsGoods-img {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.rightsGoods {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 80rpx 40rpx 0 270rpx;
box-sizing: border-box;
.rightsGoods-text {
margin-bottom: 40rpx;
font-weight: 600;
}
.rightsGoods-price {
display: flex;
.rightsGoods-number {
flex: 1;
font-size: 34rpx;
text {
font-size: 28rpx;
}
}
.rightsAdd {
display: flex;
.rightsAdd-btn {
border-radius: 4rpx;
text-align: center;
width: 50rpx;
height: 50rpx;
line-height: 45rpx;
font-size: 40rpx;
font-weight: 600;
}
.rightsAdd-remove {
background: #f8f8f8;
color: #d9d9d9;
}
.rightsAdd-remove.active,
.rightsAdd-plus {
background: #e8e4e5;
color: #6b6768;
}
.rightsAdd-input {
width: 100rpx;
text-align: center;
font-size: 28rpx;
line-height: 50rpx;
}
}
}
}
}
// 地址
.rightsList,
.notice,
.detailsStore {
background: white;
padding: 10rpx 0;
box-sizing: border-box;
}
.rightsLabel,
.rightsLabel-pay {
display: flex;
padding: 20rpx 40rpx;
color: #6c6c6c;
font-weight: 600;
font-size: 30rpx;
}
.rightsLabel-left {
flex: 1;
color: #747d86;
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
}
}
.rightsLabel-range {
display: flex;
color: #000;
font-weight: 600;
}
.rightsLabel-address {
display: flex;
position: relative;
margin: 10rpx 0;
padding: 25rpx 40rpx;
&::after,
&::before {
position: absolute;
content: '';
left: 30rpx;
width: calc(100% - 60rpx);
height: 2rpx;
background-color: #bfbfbf;
}
&::after {
top: 0;
}
&::before {
bottom: 0;
}
.rightsLabel-row {
margin-top: 30rpx;
}
.rightsLabel-icon {
width: 70rpx;
height: 70rpx;
margin-top: 14rpx;
}
.rightsLabel-right {
width: calc(100% - 80rpx);
margin-left: 10rpx;
display: flex;
font-size: 28rpx;
.rightsLabel-address-text {
flex: 1;
color: #000000;
.rightsLabel-address-name {
display: flex;
font-size: 32rpx;
margin-bottom: 10rpx;
.rightsLabel-address-tel {
padding-left: 30rpx;
color: #959595;
}
}
}
}
}
.rightsLabel-row {
width: 42rpx;
height: 42rpx;
margin: 0 0 0 6rpx;
}
// 购买须知
.notice {
background: white;
padding: 20rpx;
box-sizing: border-box;
border-top: 20rpx #eeeeee solid;
.noticeTitle {
display: flex;
.noticeTitle-flex {
flex: 1;
display: flex;
font-size: 30rpx;
line-height: 46rpx;
.noticeTitle-img {
width: 46rpx;
height: 46rpx;
margin-right: 20rpx;
}
}
.noticeTitle-row {
width: 46rpx;
height: 46rpx;
&.active {
transform: rotate(90deg);
}
}
}
.noticeText {
font-size: 26rpx;
height: 0;
overflow: hidden;
&.active {
height: auto;
}
.noticeText-top {
margin: 30rpx 0 10rpx;
font-weight: 600;
}
.noticeText-cont {
line-height: 60rpx;
}
}
}
.newrightsBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 160rpx;
z-index: 9;
background: #fff;
padding: 30rpx;
box-sizing: border-box;
display: flex;
.rightsBtn-text {
flex: 1;
font-weight: 600;
font-size: 30rpx;
.rightsBtn-text-num {
font-size: 30rpx;
margin-bottom: 10rpx;
}
text {
font-size: 38rpx;
color: #fe2d55;
}
}
button {
width: 280rpx !important;
background-color: #000000;
color: #ffffff;
border-radius: 80rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0;
margin: 0;
}
}
// 选择收货地址
.addressBack {
position: fixed;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .4);
z-index: 10;
width: 100%;
height: 100%;
display: none;
&.active {
display: block;
}
}
.addressCont {
position: fixed;
left: 0;
bottom: -1000%;
transition: .2s;
background: #fff;
z-index: 11;
width: 100%;
&.active {
bottom: 0;
}
.addressCont-title {
height: 90rpx;
line-height: 90rpx;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 600;
position: relative;
&::after {
position: absolute;
content: '';
top: 0;
left: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-left {
flex: 1;
}
.addressCont-right {
color: #309ded;
}
}
.header-classify {
white-space: nowrap;
box-sizing: border-box;
height: 600rpx;
.addressCont-list {
padding: 30rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
overflow: hidden;
position: relative;
&::after {
position: absolute;
content: '';
left: 0;
bottom: 0;
width: 100%;
height: 2rpx;
background: #f3f3f3;
}
.addressCont-top {
display: flex;
margin-bottom: 10rpx;
.addressCont-name {
font-weight: 600;
}
}
.addressCont-text {
color: #666;
width: calc(100% - 160rpx);
}
.address-tool-icon {
width: 120rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 4rpx;
text-align: center;
color: #fff;
position: absolute;
top: 45rpx;
right: 10rpx;
background: #dfae2e;
transform: scale(.9, .9);
font-size: 24rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,598 @@
<template>
<view>
<!-- 卡券详情 -->
<view class="details">
<view class="detailsTop">
<view class="detailsTop-name">
{{ details.name }}
</view>
<view class="detailsTop-time">
有效期 {{ details.startTime }} - {{ details.endTime }}
</view>
</view>
<view class="detailsCotent">
<view class="source">活动来源 {{ details.activity_name }}</view>
<view class="detailsBar">
<view class="detailsCode-text">劵码</view>
<image :src="barcode" mode="widthFix"></image>
</view>
<view class="detailsCode-text">
{{ details.code }}
</view>
<view class="detailsCode">
<image :src="qrcode" @click="refreshCode"></image>
<view class="detailsCode-text">
<text>请出示以上券码给网点工作人员</text>
</view>
</view>
<view class="petroNew" v-if="details.right">
<view class="petroNew-btn" v-if="details.right.from == 'petroNew'" @click="urlFrom">
去使用
</view>
</view>
<!-- 门店定位 -->
<view class="detailsStore">
<view class="detailsStore-top">
<view class="detailsStore-title">
适用门店
</view>
<navigator class="detailsStore-row" hover-class="none" :url="'/pages/store/index?id=' + details.id + '&type=campus'" v-if="longitude != 0 && latitude != 0">
查看所有
<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>
</view>
</view>
<!-- 使用须知 -->
<view class="detailsText">
<view class="detailsText-title">
使用须知
</view>
<view class="detailsText-tips">
<rich-text :nodes="remark"></rich-text>
</view>
</view>
<!-- 内容介绍 -->
<view class="detailsText">
<view class="detailsText-title">
内容介绍
</view>
<view class="detailsText-tips" v-if="content != null">
<rich-text :nodes="content"></rich-text>
</view>
</view>
</view>
<!-- 底部 -->
<view class="detailsBottom">
<image src="/static/img/campus_details_back.png" mode="aspectFill"></image>
<view class="detailsBottom-cont">
<view class="detailsBottom-title">
中石油活动
</view>
亿时代 - 本时生活
</view>
</view>
</view>
</template>
<script>
import { qrcode, barcode, couponinfo, merchantCard, breakCode } from '@/apis/interfaces/campus'
export default {
data() {
return {
id : 0, //优惠券id
longitude : 0, //经度
latitude : 0, //纬度
details : '', //优惠券信息
stores : [], //商家列表
content : '', //内容介绍
remark : '', //使用须知
qrcode : '', //二维码
barcode : '', //条形码
merchantcardinfo:'' //商家券信息
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 优惠券id
this.id = options.id
// 获取二维码
qrcode(options.id).then(res=>{
this.qrcode = res.qrcode
})
// 获取条形码
barcode(options.id).then(res=>{
this.barcode = res.barcode
})
},
// 生命周期函数--监听页面显示
onShow() {
// 获取详情信息
this.detailsInfo();
// 存储环境-中石油活动
getApp().globalData.envType = 'oilEnv'
// 获取定位信息
uni.getLocation({
success: res => {
this.latitude   = res.latitude
this.longitude  = res.longitude
},
complete: () => {
// 获取详情信息
this.detailsInfo();
}
})
},
methods: {
// 详情信息
detailsInfo() {
couponinfo({
coupon_id: this.id,
user_lng: this.longitude,
user_lat: this.latitude
}).then(res=>{
console.log(res)
let stores = res.stores
stores.map(res=>{
let distance = res.distance
if(res.distance > 1000){
distance = (distance / 1000) + "km"
}else{
distance = distance + "m"
}
res.km = distance
})
this.details = res.info
this.stores = stores
this.remark = res.info.right.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
this.content = res.info.right.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
//获取商家券信息
if(res.info.card_type=='merchant_card'){
this.getMerchantCardInfo()
}
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
// 商家券信息
getMerchantCardInfo(){
merchantCard(this.id).then(res=>{
this.merchantcardinfo = res
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
// 拨打电话
tel(e) {
let tel = e.currentTarget.dataset.tel
uni.showActionSheet({
itemList : ['呼叫商家电话'],
success : res =>{
if(res.tapIndex==0){
uni.makePhoneCall({
phoneNumber: tel
})
}
}
})
},
// 查看门店详情页
detailsTap(e) {
let store_id = e.currentTarget.dataset.id,
user_lng = this.longitude,
user_lat = this.latitude
uni.navigateTo({
url: '/pages/store/details?store_id=' + store_id + '&user_lng=' + user_lng + '&user_lat=' + user_lat + '&type=campus'
})
},
// 刷新二维码
refreshCode() {
breakCode(this.id).then(res=>{
uni.showToast({
title: '刷新中',
duration: 1000,
icon:'loading'
});
this.qrcode = res.qrcode
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
urlFrom () {
// #ifdef H5
window.location.href = "https://cloud1-0g37c0kwb91b41c8-1305411715.tcloudbaseapp.com/"
// #endif
}
}
}
</script>
<style>
page {
background-color: #e83241;
padding: 20rpx;
box-sizing: border-box;
}
/* 卡券详情 */
.details {
background: #ffffff;
margin: 20rpx 20rpx 0;
width: calc(100% - 40rpx);
box-shadow: 0 0 20rpx rgba(0, 0,0, .1);
position: relative;
border-radius: 0 0 20rpx 20rpx;
border-bottom: 240rpx solid transparent;
box-sizing: border-box;
overflow: hidden;
}
.details::after,
.details::before {
position: absolute;
background: #e83241;
content: '';
top: -50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.details::after {
left: -50rpx;
}
.details::before {
right: -50rpx;
}
.detailsCotent {
padding: 40rpx;
box-sizing: border-box;
}
.detailsTop {
border-bottom: 2rpx dashed #c8c8c8;
padding: 40rpx 0;
text-align: center;
box-sizing: border-box;
background-color: #f5f5f5;
}
.detailsTop-name {
font-size: 38rpx;
font-weight: 600;
margin-bottom: 20rpx;
padding: 0 60rpx;
box-sizing: border-box;
}
.detailsTop-time {
color: #7e7e7e;
font-size: 26rpx;
}
.detailsCode {
text-align: center;
padding: 0 0 20rpx;
box-sizing: border-box;
margin: 40rpx 0 20rpx;
}
.detailsCode image {
width: 300rpx;
height: 300rpx;
margin-bottom: 30rpx;
}
.detailsCode-text, .detailsStore-row {
color: #949494;
font-size: 28rpx;
}
.detailsCode-text {
text-align: center;
font-size: 32rpx;
font-weight: 600;
color: #000;
}
.detailsCode-text text {
color: #999;
font-weight: normal;
font-size: 26rpx;
}
.detailsStore {
border-top: 2rpx #c8c8c8 solid;
padding-top: 40rpx;
}
.detailsStore-top, .detailsStore-row {
display: flex;
line-height: 30rpx;
margin-bottom: 20rpx;
}
.detailsStore-title {
flex: 1;
font-weight: 600;
}
.detailsStore-row image {
width: 26rpx;
height: 26rpx;
margin: 3rpx 0 0 6rpx;
}
.detailsStore-list {
position: relative;
margin-bottom: 40rpx;
}
.detailsStore-list:last-child {
margin-bottom: 0;
}
.detailsStore-logo {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.detailsStore-cont {
position: absolute;
left: 130rpx;
top: 0;
width: calc(100% - 130rpx);
display: flex;
}
.detailsStore-left {
width: calc(100% - 90rpx);
margin-right: 30rpx;
}
.detailsStore-tel {
width: 60rpx;
height: 60rpx;
margin-top: 25rpx;
}
.detailsStore-place {
font-size: 24rpx;
line-height: 40rpx;
color: #5a5a5a;
display: flex;
}
.detailsStore-place text {
flex: 1;
display: inline-block;
font-size: 28rpx;
margin-right: 20rpx;
}
.detailsStore-name {
margin-bottom: 20rpx;
}
.detailsText {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
border-top: 2rpx solid #ececec;
}
.detailsText-title {
font-size: 32rpx;
font-weight: 600;
margin-bottom: 20rpx;
}
.detailsText-tips {
font-size: 26rpx;
line-height: 50rpx;
color: #555557;
padding-bottom: 20rpx;
}
.detailsCode-join {
color: #ee8e44;
font-size: 24rpx;
border-radius: 50rpx;
border: 2rpx solid #ee8e44;
padding: 10rpx 20rpx;
display: inline-block;
margin-top: 30rpx;
}
.detailsCode-join.active {
border: 2rpx solid #999;
color: #999;
}
.source{
margin: 30rpx 0;
font-size: 28rpx;
}
.location {
background: white;
width: 100%;
text-align: center;
margin: 60rpx 0 0;
}
.location text {
font-size: 28rpx;
display: block;
line-height: 46rpx;
color: #999;
}
.location-btn[size="mini"] {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 66rpx;
margin-top: 30rpx;
}
.location-img {
width: 150rpx;
height: 120rpx;
margin-bottom: 20rpx;
}
.detailsBar {
text-align: center;
padding: 0 50rpx;
box-sizing: border-box;
margin-top: 60rpx;
margin-bottom: 40rpx;
}
.detailsBar image {
width: 100%;
}
.detailsBar .detailsCode-text {
margin-bottom: 10px;
color: #000;
}
.detailsBottom {
position: fixed;
width: 100%;
height: 220rpx;
left: 0;
bottom: 0;
z-index: 9;
}
.detailsBottom image {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.detailsBottom-cont {
z-index: 10;
position: absolute;
left: 0;
top: 70rpx;
width: 100%;
text-align: center;
color: #9a9a9a;
font-size: 26rpx;
}
.detailsBottom-title {
font-weight: 600;
margin-bottom: 20rpx;
font-size: 30rpx;
}
.petroNew {
text-align: center;
}
.petroNew-btn {
background-color: #ee8e44;
color: #fff;
font-size: 26rpx;
line-height: 72rpx;
border-radius: 6rpx;
margin: 0 auto 50rpx;
text-align: center;
width: 50%;
}
</style>

View File

@@ -0,0 +1,266 @@
<template>
<view>
<navigator v-for="(item, idx) in adverts" :key="item.cover" :url="item.url">
<image class="campusBanner" :src="item.cover" mode="widthFix"></image>
</navigator>
<view class="recommend"></view>
<view class="film" v-for="(item, index) in oilCategories" :key="index">
<block v-if="item.petros.length > 0">
<view class="filmTitle">
{{item.title}}
</view>
<navigator hover-class="none" :url="'/pages/oil/buy?id=' + items.activity_petro_id" class="filmList" v-for="(items, indexItem) in item.petros" :key="indexItem">
<view class="filmList-top">
<view class="filmList-top-name">
{{ items.three_title || '-' }}<text>{{ items.two_title || '-'}}</text>
</view>
<view class="filmList-top-price">
<view v-if="items.button_text != null">
<view v-for="(btnItem, btnIndex) in items.button_text" :key="btnIndex">{{btnItem}}</view>
</view>
</view>
</view>
<view class="filmList-text" v-for="(itemsDes, indexDes) in items.description" :key="indexDes">
<text>{{ itemsDes }}</text>
</view>
<view class="filmList-tag" v-if="items.label != null"> <view class="filmList-tag-text">{{items.label || '-'}}</view></view>
</navigator>
</block>
</view>
<!-- 按钮 -->
<view @click="userNav('/pages/oil/myCoupon')" class="campusBtn">我的优惠券<text>立即查看</text></view>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/oil'
export default {
data() {
return {
oilCategories: '',
topData : '', // 头部推荐
oilMarket : [], // 中石油优惠券
oilPetro : [], // 超市购物券
adverts : ''
}
},
// 生命周期函数--监听页面加载
onLoad(options) {},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-中石油新活动
getApp().globalData.envType = 'oilEnv'
// 获取首页数据
this.indexInfo();
},
methods: {
// 首页数据
indexInfo() {
index().then(res=>{
this.oilCategories = res.categories
this.adverts = res.adverts
}).catch(err=>{
// if (!err.login) {
// uni.showModal({
// title: '用户登录已过期',
// content: '请重新登录',
// showCancel: false,
// success: res => {
// if (res.confirm) {
// uni.redirectTo({
// url: '/pages/oil/signin'
// });
// }
// }
// });
// }
})
},
// 处理未登录时的转跳
userNav(url){
let pageUrl = url
if(uni.getStorageSync("token")) {
uni.navigateTo({
url: pageUrl
})
return
}
// 去登录
uni.navigateTo({
url: '/pages/oil/signin'
})
},
}
}
</script>
<style lang="scss" scoped>
page {
background: linear-gradient(to bottom, #fdf5cc, #cbaf7f);
padding-bottom: 100rpx;
}
// banner
.campusBanner {
width: 100%;
}
// 推荐
.recommend {
overflow: hidden;
margin-top: -60rpx;
padding: 0 30rpx;
box-sizing: border-box;
.recommend-label {
text-align: center;
width: calc(50% - 20rpx);
float: left;
margin: 0 10rpx 30rpx;
.recommend-label-img {
width: 150rpx;
height: 150rpx;
margin: 0 auto 10rpx;
background: linear-gradient(to bottom, #293350, #484e74);
box-shadow: 0px 8px 6px rgba(249,228,129,.5);
border-radius: 50%;
box-sizing: border-box;
image {
width: 80rpx;
height: 80rpx;
margin: 35rpx;
}
}
.recommend-label-text {
font-weight: 600;
text {
display: block;
font-size: 30rpx;
}
}
}
}
// 列表
.film {
width: 100%;
padding: 10rpx 30rpx;
box-sizing: border-box;
}
.filmTitle {
background: linear-gradient(to right, #feefce, #fbe9c0, #e8d19b);
line-height: 80rpx;
box-shadow: -4px 0 10px rgba(134,97,33,.2);
text-align: center;
border-radius: 10rpx 10rpx 0 0;
color: #a47d53;
font-weight: 600;
margin: 0 20rpx;
}
.filmList {
position: relative;
background: linear-gradient(to right, #494e75, #27314d);
box-shadow: 0px 6px 10px rgba(134,97,33,.5);
border-radius: 10rpx;
padding: 50rpx 30rpx 30rpx;
box-sizing: border-box;
margin-bottom: 20rpx;
overflow: hidden;
&:last-child {
margin-bottom: 0;
}
.filmList-tag {
transform: rotate(45deg);
position: absolute;
padding: 10px 0;
right: -33px;
top: -10px;
width: 150px;
background: red;
.filmList-tag-text {
position: absolute;
color: #FFFFFF;
right: 20px;
text-align: center;
top: 2px;
font-size: 12px;;
transform:rotate(-360deg);
}
}
.filmList-top {
display: flex;
margin-bottom: 10rpx;
.filmList-top-name {
width: calc(100% - 160rpx);
margin-right: 20rpx;
color: #fce2ae;
font-size: 34rpx;
font-weight: bold;
text {
display: block;
font-size: 25rpx;
margin-top: 10rpx;
font-weight: normal;
}
}
.filmList-top-price {
position: relative;
background: linear-gradient(to right, #d3ad68, #cda65f);
box-shadow: 0px 2px 10px rgba(249,228,129,.5);
width: 120rpx;
height: 120rpx;
border-radius: 50%;
color: #FFFFFF;
text-align: center;
padding-top: 20rpx;
font-size: 30rpx;
box-sizing: border-box;
text {
display: block;
text-shadow: 0px 6px 10px rgba(134,97,33,.5);
}
.filmList-tag{
position: absolute;
background: #ff0000;
color: white;
font-size: 20rpx;
top: -10%;
left: 20%;
width: 120rpx;
padding: 0 10rpx;
line-height: 40rpx;
border-radius: 15rpx;
transform: scale(0.58)
}
}
}
.filmList-text {
font-size: 20rpx;
color: #c1c1c1;
// margin-left: -70rpx;
text {
display: block;
// transform: scale(0.8)
}
}
}
// 按钮
.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;
padding-left: 20rpx;
}
}

View File

@@ -0,0 +1,653 @@
<template>
<view>
<image class="campusCoupon" src="/static/img/oilCoupon_img.png" mode="widthFix"></image>
<view class="user">
<image src="/static/img/campusCoupon_user.png" mode=""></image> 尊敬的<text>{{ userTel }}</text>, 欢迎参加联通优惠活动
</view>
<!-- 我的卡券 -->
<view class="borderContent">
<view class="campusCont">
<!-- 卡券tab -->
<view class="couponTab">
<view class="couponTab-label" :class="{active : stateType == item.used}" @tap="orderTab" v-for="(item, index) in couponLabel" :key="index" :data-index="(index)" :data-state="(item.used)">
{{ item.title }}
<view v-if="item.used == 0">({{count.init}})</view>
<view v-else-if="item.used == 1">({{count.used}})</view>
<view v-else>({{ count.pass }})</view>
</view>
</view>
<!-- 卡券列表 -->
<view class="coupon" v-if="coupons.length > 0" :class="{active : coupons.length < 1}">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item, index) in coupons" :key="index">
<view hover-class="none" class="couponList" @tap="couponUrl" :data-id="(item.coupon_id)">
<view class="couponList-left">
<image class="couponList-img" src="/static/img/coupon_coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="/static/img/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="/static/img/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{item.activity_name}}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{item.used_at}}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
</view>
<view class="couponMore" v-if="item.count > 1" >
<view class="couponMore-text" @tap="couponTap" :data-id="(item.activityId)" :data-status="(item.status)">
<view class="couponMore-title">查看全部{{ item.count }}张卡券</view>
<image class="couponMore-arrow" src="/static/icon/arrow_left.png"></image>
</view>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="campus_tips" v-else>
<image src="/static/img/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</view>
<!-- 底部快捷导航 -->
<view class="navFooter">
<navigator hover-class="none" url="/pages/oil/index" class="navFooter-label">
<image src="/static/icon/navFooter_icon_00.png" mode=""></image>
活动中心
</navigator>
<view class="navFooter-label active">
<image src="/static/icon/navFooter_icon_01_active.png" mode=""></image>
我的优惠券
</view>
</view>
<!-- 漂浮窗 -->
<view class="indexFloat" @click="followBtn">
<image src="/static/img/subscribe.jpg" mode="aspectFill" class="indexFloat-animation"></image>
<view class="indexFloat-text">
<!-- <text>可查看大图</text> -->
<text>关注小程序</text>
</view>
</view>
<!-- 关注公众号弹出 -->
<view class="followBack" :class="{active : followState}"></view>
<view class="followPop" :class="{active : followState}">
<image class="followPop-img" src="/static/img/subscribe.jpg" mode="widthFix"></image>
<view class="followPop-text">
<text>长按识别图中二维码</text>
<image src="/static/img/follow_tips.png" mode="aspectFill"></image>
</view>
<view class="followPop-tips">
本时生活平台优惠活动
</view>
</view>
<image class="followPop-clos" :class="{active : followState}" src="/static/icon/add.png" mode="aspectFill" @click="followBtn"></image>
</view>
</template>
<script>
import { index } from '@/apis/interfaces/user'
import { coupon } from '@/apis/interfaces/campus'
export default {
data() {
return {
userTel : '', //用户者手机号
coupons : [], //优惠券列表
count : '', //优惠券-张数
//优惠券Tab列表
couponLabel : [
{ title : "未使用", used: 0 },
{ title : "已使用", used: 1 },
{ title : "已过期", used: 2 }
],
stateType : '0', //卡券状态
type : '', //卡券来源
followState : false //二维码弹出状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
// 获取用户信息
index().then(res => {
this.userTel = res.info.username
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
});
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-中石油活动
getApp().globalData.envType = 'oilEnv'
// 获取列表
this.couponInfo();
},
methods: {
// 卡券列表
couponInfo() {
coupon({
status: this.stateType,
type: 'school'
}).then(res=>{
this.count = res.count
this.coupons = res.list
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
wx.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
// tabs 选项卡
orderTab(e){
if(this.stateType != e.currentTarget.dataset.state){
this.stateType = e.currentTarget.dataset.state
// 获取卡权益
this.couponInfo()
}
},
// 查看优惠券分组
couponTap(e) {
let id = e.currentTarget.dataset.id,
status = e.currentTarget.dataset.status
uni.navigateTo({
url: '/pages/oil/myList?id=' + id + '&status=' + status
})
},
// 优惠券跳转详情
couponUrl(e) {
let newId = e.currentTarget.dataset.id
uni.navigateTo({
url: '/pages/oil/details?id=' + newId
})
},
// 公众号展示
followBtn() {
this.followState = !this.followState
}
}
}
</script>
<style>
.campusCoupon {
width: 100vw;
}
page {
background-color: #c32631;
}
/* 用户信息 */
.user {
width: 100%;
background: linear-gradient(to right, #f9ecb7, #eed276);
font-size: 28rpx;
padding: 20rpx;
box-sizing: border-box;
color: #da2025;
display: flex;
line-height: 48rpx;
}
.user text {
font-weight: 600;
padding: 0 10rpx;
}
.user image {
width: 48rpx;
height: 48rpx;
margin-right: 10rpx;
}
/* 优惠券 */
.borderContent {
border-bottom: 140rpx solid transparent;
}
.campusCont {
background-color: #e83241;
margin: 30rpx 20rpx;
border-radius: 20rpx;
padding: 20rpx;
box-sizing: border-box;
}
.campusCont.active {
border-bottom: 140rpx solid transparent;
}
.couponTab{
background-color: #d32838;
color: #ffffff;
display: flex;
padding: 20rpx 40rpx 0;
box-sizing: border-box;
border-radius: 20rpx 20rpx 0 0;
}
.couponTab-label {
flex: 3;
text-align: center;
position: relative;
padding: 10rpx 20rpx;
box-sizing: border-box;
font-size: 30rpx;
border-radius: 20rpx 20rpx 0 0;
}
.couponTab-label.active {
background-color: #fdf4ed;
color: #b9505f;
}
.couponTab-label view {
font-size: 24rpx;
margin-top: 6rpx;
}
.coupon {
padding-bottom: 10rpx;
box-sizing: border-box;
}
.couponCont {
margin: 0 0 30rpx;
width: 100%;
border-radius: 10rpx;
overflow: hidden;
}
.couponCont:last-child {
margin-bottom: 0;
}
.couponList {
background: #fdf4ed;
width: 100%;
height: 160rpx;
position: relative;
}
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
}
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius: 50%;
padding: 20rpx;
box-sizing: border-box;
}
.couponList-icon image {
width: 100%;
height: 100%;
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 35rpx;
width: calc(100% - 330rpx);
}
.couponList-center.active {
top: 15rpx;
}
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
color: #743e3e;
}
.couponList-time,
.couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-bottom: 14rpx;
color: #855757;
}
.couponList-right {
background: transparent;
border: 2rpx solid #fc9f36;
color: #f39124;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
}
.couponList-right.active {
background: #dddddd;
}
.couponMore {
font-size: 28rpx;
color: #686868;
position: relative;
height: 120rpx;
}
.couponMore::after,
.couponMore::before {
position: absolute;
content: '';
height: 20rpx;
border-radius: 10rpx;
background: #fff;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
z-index: 1;
height: 30rpx;
}
.couponMore::after {
width: calc(100% - 40rpx);
top: 70rpx;
left: 20rpx;
}
.couponMore::before {
width: calc(100% - 80rpx);
top: 90rpx;
left: 40rpx;
}
.couponMore-text {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 99;
height: 80rpx;
border-radius: 0 0 10rpx 10rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
}
.couponMore-title {
flex: 1;
}
.couponMore-arrow {
width: 28rpx;
height: 28rpx;
margin-top: 26rpx;
}
.couponCont.active .couponList-img,
.couponCont.active .couponList-icon {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.coupoTips {
position: absolute;
top: 22rpx;
right: 20rpx;
z-index: 99;
width: 120rpx;
height: 120rpx;
}
.campus_tips {
text-align: center;
width: 100%;
background-color: #ffffff;
border-radius: 0 0 20rpx 20rpx;
padding: 80rpx 0;
font-size: 28rpx;
}
.campus_tips image {
width: 160rpx;
height: 160rpx;
margin-bottom: 20rpx;
}
/* 底部快捷导航 */
.navFooter {
position: fixed;
width: 100%;
height: 110rpx;
background-color: #FFFFFF;
z-index: 1000;
left: 0;
bottom: 0;
font-size: 26rpx;
display: flex;
}
.navFooter-label {
flex: 2;
text-align: center;
width: 50%;
color: #a2a2a2;
}
.navFooter-label.active {
color: #c32631;
}
.navFooter-label image {
width: 54rpx;
height: 54rpx;
display: block;
margin: 8rpx auto 0;
}
/* 漂浮弹出层 */
.indexFloat {
position: fixed;
right: 20rpx;
bottom: 180rpx;
z-index: 99;
}
.indexFloat-text {
height: 40rpx;
overflow: hidden;
color: #000000;
}
.indexFloat-text text {
line-height: 40rpx;
display: block;
font-size: 24rpx;
}
.indexFloat-animation {
width: 130rpx;
height: 130rpx;
animation: shake 3s linear infinite;
}
@keyframes shake {
70%, 80% {
transform: rotate(7deg);
}
75% {
transform: rotate(-7deg);
}
65%,
85% {
transform: rotate(0);
}
}
/* 关注公众号弹出 */
.followBack {
position: fixed;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,.7);
left: 0;
top: 0;
z-index: 1000;
display: none;
}
.followBack.active {
display: block;
}
.followPop {
position: fixed;
z-index: 1001;
height: 760rpx;
left: 15%;
right: 15%;
top: 300rpx;
background-color: #ffffff;
border-radius: 20rpx;
text-align: center;
overflow: hidden;
display: none;
}
.followPop.active {
display: block;
}
.followPop-img {
width: 70%;
margin: 60rpx 0 50rpx;
}
.followPop-text {
color: #7d7d7d;
font-size: 32rpx;
position: relative;
}
.followPop-text::after,
.followPop-text::before {
position: absolute;
content: '';
top: 25rpx;
width: 60rpx;
height: 2rpx;
background-color: #cfcfcf;
}
.followPop-text::after {
left: 30rpx;
}
.followPop-text::before {
right: 30rpx;
}
.followPop-text image {
width: 120rpx;
height: 120rpx;
margin: 10rpx auto 20rpx;
display: block;
}
.followPop-tips {
background-color: #e1e5ec;
line-height: 90rpx;
color: #7f8487;
}
.followPop-clos {
position: fixed;
top: 1100rpx;
left: calc(50% - 25rpx);
width: 50rpx;
height: 50rpx;
z-index: 1001;
display: none;
transform: rotate(45deg);
}
.followPop-clos.active {
display: block;
}
</style>

View File

@@ -0,0 +1,315 @@
<template>
<view>
<!-- 我的卡券列表 -->
<view class="coupon" v-if="couponArr.length > 0">
<view class="couponCont" :class="{active : item.status != 0}" v-for="(item, index) in couponArr" :key="index">
<view hover-class="none" class="couponList" @tap="couponUrl" :data-id="(item.id)">
<view class="couponList-left">
<image class="couponList-img" src="/static/img/coupon_coupon_img.png"></image>
<!-- 优惠券 -->
<view class="couponList-icon" v-if="item.type == 'physical'">
<image src="/static/img/coupon_icon_01.png"></image>
</view>
<!-- 实物 -->
<view class="couponList-icon" v-else>
<image src="/static/img/coupon_icon_00.png"></image>
</view>
</view>
<view class="couponList-center" :class="{active : item.used_at != '' || item.status == 0}">
<view class="nowrap couponList-title">{{ item.name }}</view>
<view class="nowrap couponList-used" v-if="item.status == 0">活动来源 {{item.activity_name}}</view>
<view class="couponList-time">{{ item.startTime }} {{ item.endTime }}</view>
<view class="couponList-used" v-if="item.used_at != ''">使用时间{{item.used_at}}</view>
</view>
<block v-if="item.status == 0">
<view class="couponList-right">
去使用
</view>
</block>
<image v-if="item.status == 1" src="/static/img/coupon_tips_00.png" class="coupoTips"></image>
<image v-if="item.status == 2" src="/static/img/coupon_tips_01.png" class="coupoTips"></image>
</view>
</view>
</view>
<!-- 优惠券为空 -->
<view class="pack-center pages-hint" v-else>
<image src="/static/img/coupon_tips.png"></image>
<view>暂无优惠券</view>
</view>
</view>
</template>
<script>
import { couponArr } from '@/apis/interfaces/user'
export default {
data() {
return {
couponArr : '', //卡券组列表
id : '', //优惠券携带id
status : '', //优惠券携带状态
page : 1, //分页
lodingStats : false //加载状态
}
},
// 生命周期函数--监听页面加载
onLoad(options) {
this.id = options.id
this.status = options.status
},
// 生命周期函数--监听页面显示
onShow() {
// 存储环境-中石油活动
getApp().globalData.envType = 'oilEnv'
// 获取卡券组列表
this.couponInfo();
},
methods: {
// 卡券列表
couponInfo(page) {
couponArr({
activityId: this.id,
status: this.status,
page: page || ''
}).then(res=>{
let listArr = this.couponArr,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data)
this.couponArr = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
if (!err.login) {
uni.showModal({
title: '用户登录已过期',
content: '请重新登录',
showCancel: false,
success: res => {
if (res.confirm) {
uni.redirectTo({
url: '/pages/oil/signin'
});
}
}
});
}
})
},
// 优惠券跳转
couponUrl(e) {
let newId = e.currentTarget.dataset.id
uni.navigateTo({
url: '/pages/oil/details?id=' + newId
})
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取团购列表
this.couponInfo();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
this.couponInfo(pageNumber)
}
}
}
}
</script>
<style>
page {
background-color: #e83241;
}
.coupon {
margin-top: 30rpx;
}
.couponCont {
margin: 20rpx;
width: calc(100% - 40rpx);
border-radius: 10rpx;
overflow: hidden;
}
.couponList {
background: #fdf4ed;
width: 100%;
height: 160rpx;
position: relative;
}
.couponList-left {
position: relative;
left: 0;
top: 0;
width: 160rpx;
height: 160rpx;
}
.couponList-img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.couponList-icon {
position: absolute;
left: calc(50% - 56rpx);
top: calc(50% - 50rpx);
z-index: 2;
width: 100rpx;
height: 100rpx;
background: #fff;
border-radius: 50%;
padding: 20rpx;
box-sizing: border-box;
}
.couponList-icon image {
width: 100%;
height: 100%;
}
.couponList-center {
position: absolute;
left: 180rpx;
top: 35rpx;
width: calc(100% - 330rpx);
}
.couponList-center.active {
top: 15rpx;
}
.couponList-title {
margin-bottom: 10rpx;
font-size: 28rpx;
font-weight: 600;
color: #743e3e;
}
.couponList-time,
.couponList-used {
font-size: 24rpx;
color: grey;
}
.couponList-used {
margin-bottom: 14rpx;
color: #855757;
}
.couponList-right {
background: transparent;
border: 2rpx solid #fc9f36;
color: #f39124;
border-radius: 30rpx;
width: 110rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
position: absolute;
right: 20rpx;
top: 55rpx;
font-size: 24rpx;
}
.couponList-right.active {
background: #dddddd;
}
.couponMore {
font-size: 28rpx;
color: #686868;
position: relative;
height: 120rpx;
}
.couponMore::after,
.couponMore::before {
position: absolute;
content: '';
height: 20rpx;
border-radius: 10rpx;
background: #fff;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .1);
z-index: 1;
height: 30rpx;
}
.couponMore::after {
width: calc(100% - 40rpx);
top: 70rpx;
left: 20rpx;
}
.couponMore::before {
width: calc(100% - 80rpx);
top: 90rpx;
left: 40rpx;
}
.couponMore-text {
display: flex;
position: absolute;
left: 0;
top: 0;
width: 100%;
z-index: 99;
height: 80rpx;
border-radius: 0 0 10rpx 10rpx;
line-height: 80rpx;
padding: 0 30rpx;
box-sizing: border-box;
background: #fff;
box-shadow: 0 0 10rpx rgba(0, 0, 0, .1);
}
.couponMore-title {
flex: 1;
}
.couponMore-arrow {
width: 28rpx;
height: 28rpx;
margin-top: 26rpx;
}
.couponCont.active .couponList-img,
.couponCont.active .couponList-icon {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
.coupoTips {
position: absolute;
top: 22rpx;
right: 20rpx;
z-index: 99;
width: 120rpx;
height: 120rpx;
}
</style>

View File

@@ -0,0 +1,231 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<button class="campus-form-btn" form-type="submit">设置新密码</button>
</form>
</view>
</view>
</template>
<script>
import { send, auth } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]||16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || ''
auth({
mobile: mobileNo,
code: code,
type: 'reset_password'
}).then(res => {
this.$store.commit('setToken', res.token)
uni.redirectTo({
url: '/pages/oil/setPassword'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,238 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="submitRegister">
<view class="campus-inputs">
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue"
name="mobile"></input>
</view>
<view class="campus-inputs inputs-code">
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请输入密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="请确认密码" name="password_confirmation"></input>
</view>
<button class="campus-form-btn" form-type="submit">注册</button>
</form>
</view>
</view>
</template>
<script>
import { send, register } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
disabled : false,
}
},
methods: {
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
let mobileNo = this.mobileNo
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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({
title : err.message,
icon :'none',
duration: 2000
})
})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
submitRegister(e){
let formValue = e.detail.value
register({
mobile : formValue.mobile,
password : formValue.password,
password_confirmation : formValue.password_confirmation,
code : this.code,
parent_id : 0
}).then(res => {
this.$store.commit('setToken', res.token)
uni.showModal({
title : "提示",
content : "注册成功",
showCancel : false,
confirmText : "确定",
success : modalRes => {
if(modalRes.confirm){
uni.reLaunch({
url: '/pages/oil/index'
})
}
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,169 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="设置新的登录密码" name="password"></input>
</view>
<view class="campus-inputs">
<input class="campus-form-input" type="password" placeholder="确认新的登录密码" name="newpassword"></input>
</view>
<button class="campus-form-btn" form-type="submit">找回</button>
</form>
</view>
</view>
</template>
<script>
import { passSetup } from '@/apis/interfaces/auth'
export default {
data() {
return {
}
},
methods: {
// 立即登录
forgetlogin(e){
let newPass = e.detail.value.newpassword || '',
password = e.detail.value.password || ''
passSetup({
password: password,
password_confirmation: newPass
}).then(res => {
uni.showToast({
title: "密码重置成功",
icon : 'none'
})
uni.reLaunch({
url: '/pages/oil/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss">
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 30rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,260 @@
<template>
<view class="content">
<view class="campus-header">
<view class="logo">
<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>
</view>
<view class="campus-cont">
<form @submit="forgetlogin">
<view class="campus-inputs">
<image class="campus-form-icon" src="/static/img/campus_login_02.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入手机号" @input="getNameValue" name="mobile"></input>
</view>
<view class="campus-inputs inputs-code" v-if="!passwordLogin">
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="number" placeholder="请输入验证码" @input="getCodeValue" maxlength="4"></input>
<button class="campus-form-code" @tap="getCode" :disabled="disabled" hover-class="none">{{ codename }}</button>
</view>
<view class="campus-inputs" v-else>
<image class="campus-form-icon" src="/static/img/campus_login_03.png" mode="aspectFill"></image>
<input class="campus-form-input" type="password" placeholder="请输入登录密码" name="password"></input>
</view>
<view class="resPassword">
<navigator url="password">忘记密码</navigator>
</view>
<button class="campus-form-btn" form-type="submit">登录</button>
</form>
<view class="login-box">
<view @click="onCutLogin">{{passwordLogin ? '验证码登录': '密码登录'}}</view>
<navigator url="register">快速注册</navigator>
</view>
</view>
</view>
</template>
<script>
import { send, auth, passlogin } from '@/apis/interfaces/auth'
export default {
data() {
return {
codename : '获取验证码',
mobileNo : '', // 手机号
code : '', // 验证码
passwordLogin: true, // 登录方式
disabled : false,
}
},
methods: {
// 切换登录方式
onCutLogin(){
this.passwordLogin = !this.passwordLogin
},
// mobileNo
getNameValue(e) {
this.mobileNo = e.detail.value
},
// 获取code
getCode(){
console.log('sss')
let mobileNo = this.mobileNo,
myreg = /^(14[0-9]|13[0-9]|15[0-9]|17[0-9]|18[0-9]|16[0-9])\d{8}$$/
var _this = this
if (mobileNo == "") {
uni.showToast({
title : '手机号不能为空',
icon : 'none',
duration : 1000
})
return false;
}else if (!myreg.test(mobileNo)) {
uni.showToast({
title : '请输入正确的手机号',
icon : 'none',
duration : 1000
})
return false;
}else{
send({mobile: mobileNo, channel: 'LOGIN'}).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=>{})
}
},
// 获取后输入code
getCodeValue (e) {
this.code = e.detail.value
},
// 立即登录
forgetlogin(e){
let mobileNo = e.detail.value.mobile || '',
code = this.code || '',
password = e.detail.value.password || '',
loginFunction
if(this.passwordLogin){
loginFunction = passlogin({
mobile : mobileNo,
password: password
})
}else{
loginFunction = auth({
mobile: mobileNo,
code: code,
type: ''
})
}
loginFunction.then(res => {
this.$store.commit('setToken', res.token)
uni.reLaunch({
url: '/pages/oil/index'
})
}).catch(err =>{
uni.showToast({
title: err.message,
icon : 'none'
})
})
}
}
}
</script>
<style lang="scss" scoped>
.content{
min-height: 100vh;
background-image: linear-gradient(to top right, #cbaf7f, #fcf4cb);
}
.campus-cont{
padding: 40rpx 60rpx;
.campus-inputs{
position: relative;
padding-left: 90rpx;
padding-right: 30rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
margin-bottom: 30rpx;
&.inputs-code{
padding-right: 280rpx;
.campus-form-code{
width: 260rpx;
position: absolute;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: transparent;
font-size: 30rpx;
height: 90rpx;
line-height: 90rpx;
color: white;
&::after{
border: none;
}
&[disabled]{
color: rgba($color: white, $alpha: .5);
}
}
}
}
.campus-form-icon{
position: absolute;
left: 26rpx;
top: 26rpx;
width: 38rpx;
height: 38rpx;
}
.campus-form-input{
height: 90rpx;
color: white;
font-size: 32rpx;
}
.resPassword{
text-align: right;
font-size: 28rpx;
navigator{
display: inline-block;
}
}
.campus-form-btn{
margin-top: 100rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
background-image: linear-gradient(to right, #575a85, #252f4b);
font-size: 32rpx;
color: white;
}
.login-box{
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-top: 100rpx;
view{
color: #28314e;
}
}
}
.campus-header{
width: 100%;
padding-top: 70%;
position: relative;
.cover{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.logo{
position: absolute;
bottom: 80rpx;
width: 100%;
z-index: 2;
text-align: center;
image{
margin-top: 20%;
width: 160rpx;
height: 160rpx;
vertical-align: top;
margin-bottom: 30rpx;
}
.title{
font-weight: bold;
color: white;
font-size: 40rpx;
}
}
}
</style>

View File

@@ -0,0 +1,364 @@
<template>
<view>
<!-- 活动订单 -->
<view class="order-tab">
<view class="order-tab-item" :class="{active : order.stateType == 'all'}" @click="orderTab('all')">
全部
</view>
<view class="order-tab-item" :class="{active : order.stateType == 'unpay'}" @click="orderTab('unpay')">
待支付
</view>
<view class="order-tab-item" :class="{active : order.stateType == 'paid'}" @click="orderTab('paid')">
{{order.orderType == 'welfare' || order.orderType == 'rights' ? '待发货' : '已支付'}}
</view>
<view class="order-tab-item" :class="{active : order.stateType == 'delivered'}" @click="orderTab('delivered')" v-if="order.orderType == 'welfare' || order.orderType == 'rights'">
已发货
</view>
<view class="order-tab-item" :class="{active : order.stateType == 'completed'}" @click="orderTab('completed')" v-else>
已完成
</view>
</view>
<!-- 列表 -->
<view class="order-content" v-if="order.orderArr.length > 0">
<view class="order-content-li" v-for="(item,index) in order.orderArr" :key="index">
<view class="uni-border-down order-store">
<view class="order-store-title nowrap">{{ item.orderid }}</view>
<view class="order-store-stateText red" v-if="item.state_text == '未支付' || item.status_text == '未支付'">
{{ item.state_text ||item.status_text }}
</view>
<view class="order-store-stateText green" v-else-if="item.state_text == '已支付' || item.status_text == '已支付'">
{{ item.state_text || item.status_text }}
</view>
<view class="order-store-stateText" v-else>{{ item.state_text || item.status_text }}</view>
</view>
<view class="order-goods">
<image class="order-goods-cover" v-if="item.items" :src="item.items.cover" mode="aspectFill"></image>
<image class="order-goods-cover" v-else-if="item.source" :src="item.source.right.cover" mode="aspectFill"></image>
<view class="order-goods-content">
<!-- 名称 -->
<view class="order-goods-content-name nowrap" v-if="item.items">{{ item.items.title }}</view>
<view class="order-goods-content-name nowrap" v-else-if="item.source">{{ item.source.right.title }}</view>
<!-- 权益标签 实物或券 -->
<view class="orderVirtual" v-if="order.orderType == 'welfare'">{{ item.type_text }}</view>
<view class="orderVirtual" v-else-if="order.orderType == 'welfareGoods'">{{ item.type_text }}</view>
<view class="orderVirtual" :class="{active : item.items.type != 'virtual'}" v-else>
<block v-if="item.items.type == 'virtual'">红包电子券</block>
<block v-else>实物券</block>
</view>
<!-- 权益购买数量 -->
<view class="order-goods-content-price nowrap" v-if="item.items">
<text>{{ item.items.price }}</text> × {{ item.items.qty ? item.items.qty : '1' }}
</view>
<view class="order-goods-content-price nowrap" v-else-if="item.source">
<text>{{ item.source.welfare.price }}</text>× 1
</view>
</view>
</view>
<view class="uni-border-top order-btns">
<navigator class="order-btn" :url="'/pages/order/orderData?id=' + item.orderid + '&orderType=' + order.orderType">订单详情</navigator>
<!-- 取消订单 -->
<view class="order-btn" @click="orderDelete(item.orderid)" v-if="item.canCancel == true">取消订单</view>
<block v-if="item.can">
<view class="order-btn" @click="orderDelete(item.orderid)" v-if="item.can.cancel == true">取消订单</view>
</block>
<!-- 立即支付 -->
<view class="order-btn order-btn-back" @click="submitPay(item.orderid)" v-if="item.canPay == true">立即支付</view>
<block v-if="item.can">
<view class="order-btn order-btn-back" @click="submitPay(item.orderid)" v-if="item.can.pay == true">立即支付</view>
</block>
</view>
</view>
</view>
<view class="pack-center pages-hint" v-else>
<image src="/static/img/null_icon.png"></image>
<view>暂无订单</view>
</view>
</view>
</template>
<script>
import { welfare, welfareCoupons, orders, ordersCoupons, cancel, welfaresCancel } from '@/apis/interfaces/user'
import { rightsSingle } from '@/apis/interfaces/rights'
import { welfSingle } from '@/apis/interfaces/welfares'
export default {
data() {
return {
order: {
orderType : '', // 订单来源
stateType : 'all', // 状态
orderArr : [] // 列表
},
load: {
page : 1, // 第一页
allpage : 0, // 总页数
has_more: false, // 是否有分页
show : false // 是否有下一页数据
},
finished : false, // 商品列表没有更多商品是否显示
LoadData : false // 数据加载完渲染
}
},
onLoad(options) {
this.order.orderType = options.orderType
},
onShow() {
// 获取商品活动订单
this.orderInfo();
},
methods:{
// 商品活动订单
orderInfo() {
if (this.load.page == 1) {
this.order.orderArr = [];
}
let url = ''
if(this.order.orderType == 'welfare') url = welfare
if(this.order.orderType == 'welfareGoods') url = welfareCoupons
if(this.order.orderType == 'rights') url = orders
if(this.order.orderType == 'rightsCoupons') url = ordersCoupons
url({
type : this.order.stateType,
page : this.load.page
}).then(res=>{
this.order.orderArr = this.order.orderArr.concat(res.data)
this.load.allpage = res.page.total_page
this.load.has_more = res.page.has_more
})
},
// tabs
orderTab(state){
if(this.order.stateType != state){
this.order.stateType = state
// 获取商品活动订单
this.orderInfo()
}
},
// 取消订单
orderDelete(orderId) {
uni.showModal({
title : '订单取消',
content : '确认取消吗?',
success : res=> {
if (res.confirm) {
let url = ''
if(this.order.orderType == 'welfare' || this.order.orderType == 'welfareGoods') url = welfaresCancel
if(this.order.orderType == 'rights' || this.order.orderType == 'rightsCoupons') url = cancel
url(orderId).then(res=>{
// 获取商品活动订单
this.orderInfo()
})
} else if (res.cancel) {
uni.showToast({
title : '取消',
icon : 'loading',
duration: 1000
})
}
}
})
},
// 支付选择弹出
submitPay(orderid) {
let new_activity_type = '',
new_deliver = ''
// welfareGoods welfare
if(this.order.orderType == 'welfare') {
new_activity_type = 'welfare'
new_deliver = 0
this.welfSingleData(orderid).then(res => {
this.navigateUrl(res.trade_no,res.amount,new_deliver,new_activity_type)
})
}
else if(this.order.orderType == 'welfareGoods') {
new_activity_type = 'welfare'
new_deliver = 1
this.welfSingleData(orderid).then(res => {
this.navigateUrl(res.trade_no,res.amount,new_deliver,new_activity_type)
})
}
else if(this.order.orderType == 'rights') {
new_activity_type = 'right'
new_deliver = 0
this.rightsSingleData(orderid).then(res => {
this.navigateUrl(res.trade_no,res.amount,new_deliver,new_activity_type)
})
}
else {
new_activity_type = 'right'
new_deliver = 1
this.rightsSingleData(orderid).then(res => {
this.navigateUrl(res.trade_no,res.amount,new_deliver,new_activity_type)
})
}
},
// 周五福利单订单
welfSingleData(tradeNo) {
return new Promise((resolve, reject) => {
welfSingle(tradeNo).then(res=>{
resolve(res)
})
})
},
// 权益单订单
rightsSingleData(tradeNo) {
return new Promise((resolve, reject) => {
rightsSingle(tradeNo).then(res=>{
resolve(res)
})
})
},
// 跳转收银台
navigateUrl(orderid,newPrice,new_deliver,new_activity_type) {
uni.navigateTo({
url: "/pages/cashier/index?tradeNo=" + orderid + '&price=' + newPrice + "&deliver=" + new_deliver + "&activity_type=" + new_activity_type + "&type=default"
})
}
}
}
</script>
<style lang="scss" scoped>
// 活动订单
.order-tab {
position: fixed;
left: 0;
top: 0;
width: 100%;
display: flex;
height: 80rpx;
line-height: 80rpx;
z-index: 9;
background: white;
.order-tab-item {
font-size: 28rpx;
width: 25%;
text-align: center;
border-bottom: solid 2rpx #f7f7f7;
color: #464854;
background: white;
position: relative;
&.active {
color: #f57e32;
}
&::after {
content: '';
position: absolute;
width: 30rpx;
height: 4rpx;
background: transparent;
left: calc(50% - 15rpx);
bottom: -2rpx;
}
&.active::after {
background: #f57e32;
}
}
}
/* 订单列表 */
.order-content {
padding: 80rpx 0 20rpx 0;
.order-content-li {
background: white;
margin-top: 20rpx;
position: relative;
.order-store {
padding: 20rpx;
border-bottom: solid 1rpx #f3f3f3;
display: flex;
.order-store-title {
flex: 1;
color: #999;
font-size: 28rpx;
}
.order-store-stateText {
color: #e6b329;
font-size: 26rpx;
&.red {
color: #e92344;
}
&.green {
color: #79b300;
}
}
}
.order-goods {
padding: 20rpx;
box-sizing: border-box;
position: relative;
.order-goods-cover {
width: 150rpx;
height: 150rpx;
vertical-align: top;
border-radius: 4rpx;
}
.order-goods-content {
position: absolute;
left: 190rpx;
top: 20rpx;
right: 20rpx;
width: calc(100% - 210rpx);
.order-goods-content-name {
margin-bottom: 10rpx;
font-size: 30rpx;
font-weight: 600;
}
.orderVirtual {
background: #88be2d;
color: #fff;
border-radius: 4rpx;
display: inline-block;
font-size: 24rpx;
padding: 2rpx 8rpx;
&.active {
background: #f57e32;
}
}
.order-goods-content-price {
color: #747788;
display: flex;
margin-top: 10rpx;
font-size: 28rpx;
text {
color: #f57e32;
display: inline-block;
margin-right: 10rpx;
font-size: 30rpx;
}
}
}
}
.order-btns {
font-size: 25rpx;
display: flex;
padding: 20rpx;
box-sizing: border-box;
flex-wrap: wrap;
flex-direction: row-reverse;
.order-btn {
margin-left: 20rpx;
height: 52rpx;
line-height: 50rpx;
box-sizing: border-box;
border: solid 1rpx #747788;
padding: 0 20rpx;
border-radius: 30rpx;
}
.order-btn-back {
border-color: #f57e32;
color: #f57e32;
}
}
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More