Compare commits

...

7 Commits

Author SHA1 Message Date
195547d86a [最新更新] 2024-03-04 15:39:57 +08:00
a8a1c06ae4 [最新更新] 2024-03-04 15:20:20 +08:00
ee98f5921d [最新更新] 2024-03-04 15:13:17 +08:00
唐明明
edb08b4f83 调整配送方式 2023-10-11 15:03:27 +08:00
唐明明
4faf065c96 调整购物车样式 2023-10-10 10:59:56 +08:00
51a04d53ce [绚火最新] 2023-09-28 14:28:59 +08:00
ae5992fa79 [最新] 2023-09-22 17:28:59 +08:00
65 changed files with 2673 additions and 148 deletions

View File

@@ -39,6 +39,9 @@ import refund from "./interfaces/refund"
// 购物袋
import bag from "./interfaces/bag"
// 增收赋能
import empower from "./interfaces/empower"
export default {
auth,
bank,
@@ -51,5 +54,6 @@ export default {
idcard,
withdraw,
refund,
bag
bag,
empower
}

View File

@@ -35,10 +35,25 @@ const del = cart_id => req({
method : "DELETE"
})
// 购物车确认订单
const buyCarts = (data) => req({
url : "mall/buy/carts",
data
})
// 购物车下单
const postCarts = (data) => req({
url : "mall/buy/carts",
method : "POST",
data
})
export default ({
count,
add,
list,
putNum,
del
del,
buyCarts,
postCarts
})

72
api/interfaces/empower.js Normal file
View File

@@ -0,0 +1,72 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
import { req } from "../request"
//增收赋能
const lists = () => req({
url: "empower/index"
})
//增收赋能-详情
const info = (id) => req({
url: "empower/" + id + "/show"
})
//下单前置
const buyInit = (id, data) => req({
url : "empower/" + id + "/buy/init",
method : "POST",
data : data
})
//下单购买
const buy = (data) => req({
url : "empower/buy/order",
method : "POST",
data : data
})
// 订单列表初始化
const orderInit = () => req({
url : "empower/order/init"
})
// 订单列表
const orderList = (data) => req({
url : "empower/order/index",
data : data
})
// 取消订单
const orderCancel = (order) => req({
url : "empower/order/" + order + "/cancel",
})
// 核验列表
const codes = (data) => req({
url : "empower/code",
method : "POST",
data : data
})
// 确认核验
const sign = (data) => req({
url : "empower/code/sign",
method : "POST",
data : data
})
export default ({
lists,
info,
buyInit,
buy,
orderInit,
orderList,
orderCancel,
codes,
sign
})

View File

@@ -19,8 +19,15 @@ const payState = trade_id => req({
data: { trade_id }
})
// 宝付支付
const bfPay = data => req({
url: "payments/cashier_desk/baofu",
data
})
export default ({
info,
wechatPay,
payState
payState,
bfPay
})

View File

@@ -39,7 +39,13 @@
"pages/refund/deliver/deliver",
"pages/refund/logs/logs",
"pages/richText/richText",
"pages/bag/bag"
"pages/bag/bag",
"pages/bag/bagConfirm/bagConfirm",
"pages/empower/index",
"pages/empower/writeOff/writeOff",
"pages/empower/empowerInfo/empowerInfo",
"pages/empower/empowerBuy/empowerBuy",
"pages/empower/empowerOrder/empowerOrder"
],
"window": {
"backgroundTextStyle": "light",
@@ -64,14 +70,14 @@
{
"pagePath": "pages/bag/bag",
"text": "购物袋",
"iconPath": "/static/tabBarIcon/tabBar_01.png",
"selectedIconPath": "/static/tabBarIcon/tabBar_selected_01.png"
"iconPath": "/static/tabBarIcon/tabBar_03.png",
"selectedIconPath": "/static/tabBarIcon/tabBar_selected_03.png"
},
{
"pagePath": "pages/user/index",
"text": "我的",
"iconPath": "/static/tabBarIcon/tabBar_03.png",
"selectedIconPath": "/static/tabBarIcon/tabBar_selected_03.png"
"iconPath": "/static/tabBarIcon/tabBar_04.png",
"selectedIconPath": "/static/tabBarIcon/tabBar_selected_04.png"
}
],
"color": "#999999",
@@ -79,8 +85,14 @@
"borderStyle": "white"
},
"requiredPrivateInfos": [
"chooseAddress"
"chooseAddress",
"getFuzzyLocation"
],
"permission": {
"scope.getFuzzyLocation": {
"desc": "位置信息仅用于商品配送"
}
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

View File

@@ -20,11 +20,18 @@
<!-- 进图条 -->
<view class="bar" wx:if="{{examine.show}}">
<view class="bar-title">销售补贴考核进度</view>
<view class="bar-title">
<view class="bar-title-left">销售补贴考核进度</view>
<view>¥{{examine.amount}} <text>元</text></view>
</view>
<view class="bar-line">
<view class="progress" style="width: 100%"></view>
<view class="progress-box" style="width: {{examine.amount < examine.need ? examine.amount : '100'}}%">
<view class="progress-box-name {{examine.amount == 0 ? 'active' : ''}}" wx:if="{{examine.need != examine.amount}}">{{examine.amount}}</view>
<!-- <view class="progress-box-name {{examine.amount == 0 ? 'active' : ''}}" wx:if="{{examine.need != examine.amount}}">{{examine.amount}}</view> -->
</view>
<view class="progress-see-name">
<view class="progress-see-name-left">0</view>
<view>{{examine.need}}</view>
</view>
<!-- <view class="progress" style="width: {{examine.need}}%">
<view class="progress-box" style="width: {{examine.amount < examine.need ? examine.amount : '100'}}%">

View File

@@ -15,13 +15,16 @@ page { background-color: #f6f6f6; }
/* 进度条 */
.bar {margin: 30rpx; background-color: #ffffff; border-radius: 20rpx;box-sizing: border-box; padding: 30rpx;}
.bar-title {font-weight: 600; margin-bottom: 30rpx;}
.bar-line {width: 100%; height: 60rpx; overflow: hidden;position: relative;}
.bar-title {font-weight: 600; margin-bottom: 30rpx; display: flex;}
.bar-title-left {flex: 1;}
.bar-line {width: 100%; height: 70rpx; overflow: hidden;position: relative;}
.progress {height: 20rpx; background-color: #ffb0c2;position: absolute; left: 0; top: 0;}
.progress-box {position: absolute; background-color: #dc3159; height: 20rpx;}
.progress-box-name {right: 0rpx;top: 35rpx;position: absolute; font-size: 24rpx; color: #dc3159;}
.progress-box-name.active {right: -15rpx;}
.progress-name {position: absolute;right: 0rpx;top: 35rpx; font-size: 24rpx; color: rgb(146, 146, 146);}
.progress-see-name {display: flex; margin-top: 30rpx;}
.progress-see-name-left {flex: 1;}
/* 收益明细 */
.listTitle { padding: 30rpx 30rpx 0; font-weight: 600; box-sizing: border-box; font-size: 30rpx; }

View File

@@ -172,13 +172,18 @@ Page({
if (goodsList[j].shop.mallState){
sellerLengh++
if (sellerLengh == goodsList.length){
console.log('全选')
allCheckbox = true
}else{
console.log('取消全选')
allCheckbox = false
}
}
}
if(sellerLengh == 0) {allCheckbox = false}
this.allCheckbox('checkbox')
this.setData({
@@ -192,6 +197,7 @@ Page({
* 全选
*/
allCheckbox(type){
console.log(type)
let goodsLenght = 0,
allCheckbox = this.data.allCheckbox,
goodsList = this.data.bags
@@ -253,9 +259,9 @@ Page({
bagOrderLoading:true
})
if (this.data.bagId != ''){
console.log('提交的数据id:' + this.data.bagId)
wx.navigateTo({
url: './bagConfirm/bagConfirm?skuId=' + this.data.bagId
})
// setTimeout(() => {
// this.setData({
// bagOrderLoading: false

View File

@@ -1,5 +1,5 @@
<view class="content">
<block wx:if="{{isUser}}">
<!-- 工具栏 -->
<view class="bag-header">
<view class="bag-header-add-select">
@@ -45,19 +45,23 @@
<!-- 购物袋为空 -->
<view class="pack-center pages-hint" wx:else>
<image src="/static/icons/null_icon.png"></image>
<image src="/static/icons/carnull_icon.png"></image>
<view>购物袋中暂无任何商品</view>
</view>
<!-- 用户未登录 -->
<view class="pack-center pages-loding" wx:if="{{!isUser}}">
<view>未登录,无法获取您的购物车信息</view>
</view>
<!-- 结算 -->
<view class="bag-footer">
<view class="bag-footer-price">合计<text>¥{{allPrice}}</text></view>
<view class="bag-footer-rests">共计{{bagNumber}}件,不含运费</view>
<view class="bag-footer-rests">共计{{bagNumber}}件</view>
<button class="bag-footer-btn" size="mini" bindtap="bagOrder" disabled="{{bagOrderLoading}}" loading="{{bagOrderLoading}}">结算</button>
</view>
</block>
<block wx:else>
<!-- 用户未登录 -->
<view class="pack-center pages-loding auth-login">
<view>您还未登录,无法查看您的购物车信息</view>
<navigator class="auth-btn" url="/pages/login/index">登录</navigator>
</view>
</block>
</view>

View File

@@ -1,6 +1,8 @@
.content{ background: #f7f8f9; min-height: 100vh; }
.pack-center {z-index: 9;}
/* 工具栏 */
.bag-header{ border-bottom: solid 1rpx #f1f1f1; padding: 25rpx 30rpx; overflow: hidden; position: fixed; width: 100%; top: 0; left: 0; box-sizing: border-box; line-height: 40rpx; }
@@ -106,3 +108,8 @@
.checkbox checkbox .wx-checkbox-input{ background: white; border-radius: 50%; border:solid 3rpx #464854; height: 34rpx; width: 34rpx; }
.checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked{ background: #da2b54; border-color: #da2b54; }
.checkbox checkbox .wx-checkbox-input.wx-checkbox-input-checked:before{ top: 18rpx; right: 5rpx; color: white; line-height: 34rpx; text-align: center; width: 36rpx; height: 36rpx; font-size:36rpx; }
/* 未登录 */
.auth-login{ text-align: center; font-size: 28rpx; color: gray; background: white; }
.auth-login image{ width: 218rpx; height: 218rpx; margin-bottom: 30rpx; }
.auth-btn{ background: #da2b54; display: inline-block; width: 240rpx; height: 80rpx; line-height: 80rpx; border-radius: 40rpx; font-size: 32rpx; color: white; margin-top: 100rpx; }

View File

@@ -0,0 +1,105 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
disabled : true, //按钮
skuId : '',
address : '', // 地址
goodskData : '', // 数据
amount : '', // 商品总金额
total : '', // 支付金额
freight : '', // 运费
weight : '', // 重量
distribution : [
{ type: 0, title: "选择配送方式" },
{ type: 1, title: "快递" },
{ type: 2, title: "自提" },
],
distributionIndex: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
skuId : options.skuId
})
// 获取商品下单信息
this.placeInfo(options.skuId);
},
/**
* 配送方式选择
*/
distributionChange(e){
if(e.detail.value === this.data.distributionIndex) return
this.setData({
distributionIndex: e.detail.value
})
this.placeInfo(this.data.skuId);
},
/**
* 商品下单信息
*/
placeInfo(skuid, type) {
wx.showLoading({
title: '加载中...',
mask : true
})
wx.$api.bag.buyCarts({
cart_ids : skuid,
address_id : this.data.address.address_id || '',
delivery_type: this.data.distributionIndex
}).then(res => {
if(type != 'chooseAdd'){
this.setData({
address: res.data.address,
})
}
this.setData({
goodskData: res.data.detail,
amount : res.data.amount,
total : res.data.total,
freight : res.data.freight,
weight : res.data.weight
})
wx.hideLoading()
})
},
/**
* 商品确认下单
*/
buyTap() {
if(this.data.distributionIndex == 0){
wx.showToast({
title: '请选择配送方式',
icon : 'none'
})
return
}
wx.showLoading({
title: '下单中...',
mask : true
})
wx.$api.bag.postCarts({
cart_ids : this.data.skuId,
address_id : this.data.address.address_id,
remark : '',
delivery_type : this.data.distributionIndex
}).then(res => {
wx.redirectTo({
url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data))
})
wx.hideLoading()
}).catch(() =>{}).finally(() => {})
},
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "购物车订单确认"
}

View File

@@ -0,0 +1,83 @@
<view class="borderBottom">
<!-- 地址 -->
<view class="address" wx:if="{{distributionIndex == 1}}">
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress&skuid={{skuId}}&qty={{goodsQty}}" class="address-cont" wx:if="{{address}}">
<view class="address-top">
<view class="address-area">
<image class="address-icon" src="/static/icons/address.png" mode="widthFix"></image>{{address.province.name}}{{address.city.name}}
</view>
<view class="address-text">{{address.full_address}}</view>
</view>
<view class="address-name">
{{address.name}}<text>{{address.mobile}}</text>
</view>
<image class="address-arrow" src="/static/icons/orderArrow.png"></image>
</navigator>
<view class="address-add" wx:else>
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress&skuid={{skuId}}&qty={{goodsQty}}" class="address-go">新增收货地址 +</navigator>
</view>
<image class="address-img" src="/static/imgs/address.png" mode="widthFix"></image>
</view>
<!-- 商品 -->
<view class="more-goods-block">
<view class="more-goods" wx:for="{{goodskData}}" wx:key="stockData">
<view class="more-name">
<image src="/static/icons/shopIcon.png"></image>{{item.shop.name}}
</view>
<view class="list-goods" wx:for="{{item.items}}" wx:key="items" wx:for-item="items">
<image class="list-goods-img" mode="aspectFill" src="{{items.cover ? items.cover : '/static/ls/1.jpg'}}"></image>
<view class="list-goods-cont">
<view class="nowrap list-goods-name">{{items.title}}</view>
<view class="list-goods-text">
<text>购买数量</text> x{{items.qty}}
</view>
<view class="list-goods-parice">
¥<text>{{items.price}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 配送方式 -->
<view class="label">
<view class="label-item">
<view class="label-name">配送方式</view>
<picker range="{{distribution}}" range-key="title" class="label-picker" value="{{distributionIndex}}" bindchange="distributionChange">
<view class="label-picker-val">{{distribution[distributionIndex].title}}<image class="label-picker-icon" src="/static/icons/arrow_more.png"></image>
</view>
</picker>
</view>
<!-- <navigator class="label-item" wx:if="{{distributionIndex == 1}}" url="/pages/store/store">
<view class="label-name">自提门店</view>
<view class="label-text">华鸿国际自提点<image class="label-picker-icon" src="/static/icons/arrow_more.png"></image></view>
</navigator> -->
</view>
<!-- 规格 -->
<view class="label">
<view class="label-item" wx:if="{{distributionIndex == 0}}">
<view class="label-name">快递</view>
<view class="label-text">{{freight == 0 ? '免邮' : '¥' + freight + '元'}}</view>
</view>
<view class="label-item">
<view class="label-name">重量</view>
<view class="label-text">{{weight}}g</view>
</view>
<view class="label-item">
<view class="label-name">金额</view>
<view class="label-integral">¥{{amount}}</view>
</view>
</view>
</view>
<!-- 底部 -->
<view class="footer">
<view class="number">
<view class="number-vip">合计:</view>
<text>¥</text>
<view class="number-price">{{total}}</view>
</view>
<view class="btn {{disabled ? '': 'active'}}" bindtap="buyTap">立即支付</view>
</view>

View File

@@ -0,0 +1,322 @@
page {
background-color: #f5f6f8;
padding: 30rpx;
box-sizing: border-box;
}
.borderBottom {
border-bottom: 110rpx solid transparent;
}
/* 地址 */
.address {
background-color: #FFFFFF;
border-radius: 15rpx;
overflow: hidden;
position: relative;
margin-bottom: 30rpx;
}
.address-arrow {
position: absolute;
right: 15rpx;
top: 78rpx;
width: 50rpx;
height: 50rpx;
}
.address-cont {
padding: 30rpx;
box-sizing: border-box;
}
.address-top {
width: calc(100% - 80rpx);
}
.address-area {
color: #585866;
font-size: 28rpx;
display: flex;
line-height: 40rpx;
}
.address-icon {
width: 40rpx;
margin-right: 20rpx;
}
.address-text {
font-weight: 600;
padding: 10px 0;
}
.address-name text {
color: #585866;
padding-left: 30rpx;
}
.address-img {
width: 100%;
height: 10rpx;
display: block;
}
.address-add {
width: 100%;
text-align: center;
padding: 30rpx 30rpx 0;
box-sizing: border-box;
}
.address-go {
display: inline-block;
font-size: 28rpx;
line-height: 68rpx;
border-radius: 10rpx;
color: #df723a;
padding-bottom: 20rpx;
}
/* 商品 */
.more-goods-block{
background-color: #FFFFFF;
border-radius: 15rpx;
}
.more-goods {
border-bottom: solid 1rpx #f7f8f9;
}
.more-goods:last-child{
border-bottom: none;
}
.more-name {
padding: 30rpx 30rpx 0;
box-sizing: border-box;
font-weight: 600;
display: flex;
line-height: 38rpx;
}
.more-name image {
width: 38rpx;
height: 38rpx;
margin-right: 10rpx;
}
.list-goods {
background-color: #FFFFFF;
display: flex;
padding: 30rpx;
border-radius: 15rpx;
box-sizing: border-box;
}
.list-goods-img {
width: 184rpx;
height: 184rpx;
margin-right: 30rpx;
border-radius: 10rpx;
}
.list-goods-cont {
width: calc(100% - 214rpx);
}
.list-goods-name {
font-size: 32rpx;
}
.list-goods-text {
line-height: 90rpx;
display: flex;
font-size: 28rpx;
color: #999999;
}
.list-goods-text text {
flex: 1;
}
.list-goods-parice {
font-size: 26rpx;
}
.list-goods-parice text {
font-size: 34rpx;
}
/* 规格 */
.label {
background-color: #FFFFFF;
border-radius: 15rpx;
overflow: hidden;
box-sizing: border-box;
margin-top: 30rpx;
}
.label-item {
display: flex;
line-height: 100rpx;
color: #585866;
font-size: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-bottom: 2rpx solid rgb(243, 243, 243);
}
.label-item:last-child {
border: none;
}
.label-integral {
color: #da2b54;
font-weight: 600;
}
.label-name {
flex: 1;
}
.label-picker{ width: 70%; }
.label-picker-val{ text-align: right; display: flex; align-items: center; justify-content: flex-end;}
.label-picker-icon{ width: 24rpx; height: 24rpx; margin-left: 10rpx; }
/*checkbox选中后样式 */
.label-text-checkbox {
margin-right: -14rpx;
margin-left: 10rpx;
}
.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background: #da2b54;
border-color: #da2b54;
}
.label-text-checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
width: 30rpx;
height: 30rpx;
line-height: 28rpx;
text-align: center;
font-size: 30rpx;
color: #fff;
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}
.label-price {
text-align: right;
line-height: 90rpx;
font-size: 30rpx;
font-weight: 600;
padding: 0 30rpx 5rpx;
box-sizing: border-box;
}
.label-price text {
font-size: 34rpx;
padding: 0 10rpx;
}
.label-number {
display: flex;
margin-top: 25rpx;
height: 48rpx;
border: 2rpx solid #d7d7d7;
border-radius: 10rpx;
}
.number-btn {
background-color: transparent;
width: 48rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
}
.number-input {
width: 80rpx;
text-align: center;
height: 48rpx;
border-left: 2rpx solid #d7d7d7;
border-right: 2rpx solid #d7d7d7;
}
/* 底部 */
.footer {
width: 100%;
height: 60px;
background-color: #ffffff;
position: fixed;
left: 0;
bottom: 0;
z-index: 9;
box-sizing: border-box;
display: flex;
}
.number {
flex: 1;
line-height: 60px;
color: #da2b54;
display: flex;
padding: 0 30rpx;
box-sizing: border-box;
}
.number text {
font-size: 28rpx;
padding-top: 5rpx;
}
.number-price {
padding: 0 5rpx;
font-size: 40rpx;
}
.number-vip {
margin-left: 20rpx;
color: #8d97a1;
font-size: 28rpx;
}
.btn {
height: 100%;
background-color: #da2b54;
text-align: center;
color: #FFFFFF;
padding: 0 70rpx;
line-height: 60px;
}
.btn-disabled {
line-height: 60px;
text-align: center;
border: none;
border-radius:0;
background-color: #da2b54;
padding: 0;
margin: 0;
}
button[disabled]{
padding: 0;
padding: 0;
height: 60px;
line-height: 60px;
background-color: transparent !important;
}
.btn.active {
background-color: #cacaca;
}
.detailsBrief-back{
width: 100%;
}
.grey {
background-color: #f9f9f9;
z-index: 99999;
}

View File

@@ -0,0 +1,137 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
semesters : [],
formData : [{
name : '',
mobile : '',
index : 0
}],
empower : {},
allPrice : '0.00',
semestersIndex : 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
empowerId: options.id
})
this.indexInfo(options.id)
},
/**
* 增收赋能-报名
*/
indexInfo(id) {
wx.$api.empower.buyInit(id).then(res => {
let { empower, semesters } = res.data;
this.setData({
empower : empower,
semesters : semesters
})
this.getTotalPrice()
}).catch(err => {})
},
// 计算价格
getTotalPrice(){
let totalPrice = 0
this.data.formData.map(val => {
totalPrice += Number(this.data.semesters[val.index].price)
})
this.setData({
allPrice : totalPrice.toFixed(2)
})
},
/**
* 选择学期
*/
onChange(e) {
let that = this
var val = e.detail.value;
let index = e.currentTarget.dataset.index // 获取数据的索引
let reward = 'formData[' + index +'].index' // 获取lists[index].reward
that.setData({
[reward]: val
})
},
// 添加新用户
onAddUser(){
var lists = this.data.formData;
var newData = {
name : '',
mobile : '',
index : 0
};
lists.push(newData);
this.setData({
formData: lists,
})
this.getTotalPrice()
},
// 删除用户
onRemoveUser (e) {
var lists = this.data.formData;
let index = e.currentTarget.dataset.index
lists.splice(index,1)
this.setData({
formData: lists,
})
},
// 真实姓名
bindName(e) {
let that = this
var val = e.detail.value;
let index = e.currentTarget.dataset.index // 获取数据的索引
let reward = 'formData[' + index +'].name' // 获取lists[index].reward
that.setData({
[reward]: val
})
},
// 手机号码
bindTel(e) {
let that = this
var val = e.detail.value;
let index = e.currentTarget.dataset.index // 获取数据的索引
let reward = 'formData[' + index +'].mobile' // 获取lists[index].reward
that.setData({
[reward]: val
})
},
// 提交报名
onSubmit(){
let submitData = this.data.formData.map(val => {
return {
name : val.name,
mobile : val.mobile,
semester_id : this.data.semesters[val.index].id
}
})
wx.$api.empower.buy({
empower_id : this.data.empowerId,
data : submitData
}).then(res => {
wx.redirectTo({
url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data))
})
}).catch(err => {})
}
})

View File

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

View File

@@ -0,0 +1,42 @@
<view class="content">
<!-- 课程信息 -->
<view class="info">
<image class="info-cover" src="{{empower.cover}}" mode="aspectFill"></image>
<view class="info-text">
<view class="info-title">{{empower.title}}</view>
<view class="info-subtitle">{{empower.sub_title}}</view>
<view class="info-price"><text>¥</text>{{empower.price}}</view>
</view>
</view>
<!-- 报名信息 -->
<view class="user-title">报名人</view>
<view class="user-block" wx:for="{{formData}}" wx:key="formData">
<view class="user-block-flex">报名信息{{index + 1}}<view class="user-block-remove" wx:if="{{formData.length > 1}}" bindtap="onRemoveUser" data-index="{{index}}">删除</view>
</view>
<view class="user-block-input">
<label>真实姓名</label>
<input placeholder="输入姓名" value="{{item.name}}" data-index="{{index}}" maxlength="10" bindinput="bindName" />
</view>
<view class="user-block-input">
<label>手机号码</label>
<input placeholder="输入手机号码" value="{{item.mobile}}" data-index="{{index}}" bindinput="bindTel" maxlength="11" type="number" />
</view>
<view class="user-block-input" wx:if="{{semesters.length > 0}}">
<label>选择学期</label>
<picker mode="selector" value="{{semestersIndex}}" data-index="{{index}}" range="{{semesters}}" range-key="title" bindchange="onChange">
<view class="nowrap user-block-picker">{{semesters[item.index].title}}</view>
<image class="picker-icon" src="/static/icons/empowerArrow.png"></image>
</picker>
</view>
</view>
<view class="user-add" bindtap="onAddUser">
<image src="/static/icons/siteIcon.png"></image>添加报名人
</view>
<view class="footer">
<view class="footer-text">
<view class="footer-text-price"><text>¥</text>{{allPrice}}</view>
<view class="footer-text-subtitle">共计{{formData.length}}人报名</view>
</view>
<button class="footer-btn" bindtap="onSubmit">提交</button>
</view>
</view>

View File

@@ -0,0 +1,190 @@
.content {
background: #f7f8f9;
padding: 30rpx 30rpx 210rpx;
min-height: calc(100vh - 44px);
box-sizing: border-box;
}
/* 报名人信息 */
.user-title {
padding-top: 30rpx;
font-size: 30rpx;
line-height: 40rpx;
color: gray;
}
.user-block {
background: white;
margin-top: 30rpx;
border-radius: 20rpx;
padding: 20rpx 30rpx;
}
.user-block-flex {
display: flex;
justify-content: space-between;
height: 90rpx;
align-items: center;
font-size: 30rpx;
color: gray;
}
.user-block-remove {
color: #da2b56;
line-height: 90rpx;
}
.user-block-input {
display: flex;
justify-content: space-between;
height: 90rpx;
align-items: center;
flex-wrap: wrap;
}
label {
font-size: 32rpx;
width: 200rpx;
}
picker,
input {
width: calc(100% - 200rpx);
font-size: 32rpx;
}
picker {
position: relative;
}
.user-block-picker {
padding-right: 30rpx;
box-sizing: border-box;
position: relative;
width: calc(100% - 42rpx);
display: inline-block;
}
.picker-icon {
width: 42rpx;
height: 42rpx;
}
.user-add {
text-align: center;
background: white;
border-radius: 20rpx;
margin-top: 30rpx;
display: flex;
align-items: center;
height: 120rpx;
justify-content: center;
color: #da2b56;
font-size: 32rpx;
}
.user-add image {
width: 38rpx;
height: 38rpx;
margin-right: 15rpx;
}
/* 报名课程信息 */
.info {
display: flex;
background: white;
padding: 30rpx;
border-radius: 20rpx;
flex-wrap: wrap;
justify-content: space-between;
}
.info-cover {
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
.info-text {
width: calc(100% - 210rpx);
}
.info-title {
font-size: 38rpx;
font-weight: bold;
line-height: 50rpx;
height: 50rpx;
}
.info-subtitle {
line-height: 40rpx;
height: 80rpx;
font-size: 30rpx;
}
.info-price {
font-weight: bold;
color: #da2b56;
font-size: 42rpx;
font-family: Arial, Helvetica, sans-serif;
line-height: 50rpx;
height: 50rpx;
}
.info-price text {
font-size: 80%;
margin-right: 5rpx;
}
/* 底部 */
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 30rpx 30rpx 50rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
z-index: 99;
box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, .04);
background: white;
}
.footer-text {
width: 200rpx;
margin-right: 30rpx;
flex: 1;
}
.footer-text-price {
font-weight: bold;
color: #da2b56;
font-size: 40rpx;
}
.footer-text-price text {
font-size: 80%;
margin-right: 5rpx;
}
.footer-text-subtitle {
font-size: 28rpx;
color: gray;
}
.footer-btn {
background: #da2b56;
color: white;
line-height: 100rpx;
border-radius: 50rpx;
flex: 1;
text-align: center;
font-weight: bold;
font-size: 36rpx;
padding: 0 80rpx;
}
.footer-btn::after {
display: none;
}

View File

@@ -0,0 +1,75 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
empowerId : '', //增收赋能id
id : '',
cover : '',
title : '',
subtitle : '',
price : '0.00',
semester : null,
count : {},
content : []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
empowerId: options.id
})
this.indexInfo(options.id)
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 增收赋能-详情
*/
indexInfo(id) {
wx.$api.empower.info(id).then(res => {
console.log(res.data)
let { cover, title, subtitle, price, semester_current, count, content, id } = res.data;
this.setData({
id : id,
cover : cover,
title : title,
subtitle : subtitle,
price : price,
semester : semester_current,
count : count,
content : content.replace(/\<img/gi, '<img style="width:100%;height:auto"')
})
wx.setNavigationBarTitle({ title })
}).catch(err => {})
},
/**
* 增收赋能-立即购买
*/
onBuy(){
if(this.data.count.ing <= 0){
wx.showToast({
title: '暂无可报名学期',
icon : 'none'
})
return
}
wx.navigateTo({
url: "/pages/empower/empowerBuy/empowerBuy?id=" + this.data.id
})
}
})

View File

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

View File

@@ -0,0 +1,36 @@
<view class="content">
<!-- 封面 -->
<view class="cover">
<image class="cover-src" src="{{cover}}" mode="aspectFill"></image>
</view>
<!-- 课程信息 -->
<view class="info">
<view class="info-title">{{ title }}</view>
<view class="info-subtitle">{{ subtitle }}</view>
<view class="info-info">
<view class="info-info-item">
<label>总学期</label>
<view class="info-value">{{count.all || '-'}}期</view>
</view>
<view class="info-info-item">
<label>已结束</label>
<view class="info-value">{{count.over || 0}}期</view>
</view>
<view class="info-info-item" wx:if="{{semester != null}}">
<label>当期时间</label>
<view class="info-value">{{semester.time.start || '-'}}</view>
</view>
<view class="info-info-item" wx:if="{{semester != null}}">
<label>报名价格</label>
<view class="info-value price">¥{{semester.price || '0.00'}}</view>
</view>
</view>
</view>
<!-- 课程介绍 -->
<rich-text nodes="{{content}}"></rich-text>
<!-- 报名信息 -->
<view class="footer">
<view class="footer-btn {{count.ing <= 0 ? 'in' : ''}}" bindtap="onBuy">立即购买</view>
</view>
</view>

View File

@@ -0,0 +1,104 @@
.content {
padding-bottom: 180rpx;
}
/* 封面图 */
.cover {
position: relative;
padding-top: 70%;
background: #f7f8f9;
}
.cover-src {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* 信息 */
.info {
padding: 40rpx;
}
.info-title {
font-weight: bold;
font-size: 50rpx;
margin-bottom: 20rpx;
line-height: 65rpx;
color: #333;
text-align: justify;
}
.info-subtitle {
font-size: 30rpx;
line-height: 50rpx;
margin-bottom: 40rpx;
color: #333;
text-align: justify;
}
.info-info {
background: #f7f8f9;
padding: 0 30rpx;
font-size: 30rpx;
border-radius: 20rpx;
}
.info-info-item {
padding: 30rpx 0;
line-height: 40rpx;
display: flex;
justify-content: space-between;
}
label {
font-weight: bold;
width: 170rpx;
}
.info-info-item:last-child::after {
display: none;
}
.info-value {
width: calc(100% - 170rpx);
text-align: right;
font-family: Arial, Helvetica, sans-serif;
}
.info-value.price {
font-weight: bold;
color: #da2b56;
}
/* 底部 */
.footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 30rpx 30rpx 50rpx;
display: flex;
flex-wrap: wrap;
align-items: center;
z-index: 99;
background-color: white;
box-shadow: 0 0 10rpx 10rpx rgba(0, 0, 0, .04);
}
.footer-btn {
background: #da2b56;
color: white;
line-height: 100rpx;
border-radius: 50rpx;
flex: 1;
text-align: center;
font-weight: bold;
font-size: 36rpx;
}
.footer-btn.in {
opacity: .6;
}

View File

@@ -0,0 +1,178 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
statusArr : [{ title: '全部订单', id: '' }],
empowerArr : [{ title: '全部课程', id: '' }],
statusIndex : 0,
empowerIndex: 0,
// 报名信息
users : [],
usersTotal : 0,
usersShow : false,
// 订单列表
orders : [],
// 分页
page : {}, // 分页信息
lodingStats : false,// 加载状态
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
wx.$api.empower.orderInit().then(res => {
let { status, empower } = res.data;
this.setData({
statusArr : status,
empowerArr : [...this.data.empowerArr, ...empower]
})
// 获取列表
this.getList()
}).catch(err => {})
},
// 筛选类型
onPickerChange(e){
this.setData({
statusIndex: e.detail.value
})
this.getList()
},
// 筛选类型-课程
onPickerClass(e){
this.setData({
empowerIndex: e.detail.value
})
this.getList()
},
/**
* 获取列表
*/
getList(page) {
wx.$api.empower.orderList({
page : page || 1,
status : this.data.statusArr[this.data.statusIndex].id,
empower : this.data.empowerArr[this.data.empowerIndex].id
}).then(res => {
let listArr = this.data.orders,
newData = []
if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.data)
newData.map(val => {
val.is_show_type = false
})
this.setData({
orders : newData,
page : res.data.page,
lodingStats : false
})
wx.stopPullDownRefresh()
}).catch(err => {})
},
/**
* 课程数量
*/
typeTap(e) {
let index = e.currentTarget.dataset.index
this.setData({
[`orders[${index}].is_show_type`]: !this.data.orders[index].is_show_type
});
},
/**
* 报名信息
*/
onShowUsers(val) {
let { count, lists } = val.currentTarget.dataset.items
this.setData({
users : lists,
usersTotal : count,
usersShow : true
})
},
/**
* 报名信息弹出关闭
*/
usersHide() {
this.setData({
usersShow: false
})
},
/**
* 取消订单
*/
onCancel(e){
let id = e.currentTarget.dataset.id
wx.showModal({
title : '提示',
content : '取消订单后无法找回,确认取消吗?',
success : modalRes => {
if(modalRes.confirm){
wx.showLoading({
title: '加载中...',
mask : true
})
wx.$api.empower.orderCancel(id).then(res => {
wx.showToast({
title: '订单已取消',
icon : 'none'
})
this.getList()
}).catch(err => {})
}
}
})
},
/**
* 支付
*/
onPay(e){
let data = e.currentTarget.dataset.item
wx.redirectTo({
url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(data))
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
// 获取订单列表
this.getList()
},
/**
* 上拉加载
*/
onReachBottom(){
this.setData({
lodingStats: true
})
let pageNumber = this.data.page.current
if(this.data.page.has_more){
pageNumber++
// 获取订单列表
this.getList(pageNumber)
}
},
})

View File

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

View File

@@ -0,0 +1,98 @@
<view class="content">
<!-- tabs -->
<view class="screen-flex">
<view class="screen-picker">
<picker range="{{statusArr}}" range-key="title" value="{{statusIndex}}" bindchange="onPickerChange">
<view class="screen-text">
{{ statusArr[statusIndex].title }}<image class="screen-icon" src="/static/icons/empowerArrow.png"></image>
</view>
</picker>
</view>
<view class="screen-picker">
<picker range="{{empowerArr}}" range-key="title" value="{{empowerIndex}}" bindchange="onPickerClass">
<view class="screen-text">
{{ empowerArr[empowerIndex].title }}<image class="screen-icon" src="/static/icons/empowerArrow.png"></image>
</view>
</picker>
</view>
</view>
<!-- 订单管理列表 -->
<view class="orders" wx:if="{{orders.length > 0}}">
<view class="orders-item" wx:for="{{orders}}" wx:key="orders">
<view class="orders-flex">
<view class="no nowrap" bindtap="copyNo" data-no="item.order_no">
<text class="orders-tag" wx:if="{{!item.is_my}}">客户</text>
<text class="orders-tag order-tag-my" wx:else>个人</text>
{{item.order_no}}
</view>
<view class="state">{{item.status_text}}</view>
</view>
<view class="orders-content">
<view class="orders-content-item">
<label>课程名称</label>
<view class="nowrap orders-content-type">{{item.empower.title}}</view>
</view>
<view class="orders-content-item orders-content-bottom" bindtap="typeTap" data-index="{{index}}" data-type="{{item.is_show_type}}">
<label>课程数量</label>
<view class="nowrap orders-content-type">
×{{item.items.count}}<image class="orders-content-icon {{item.is_show_type ? 'active' : ''}}" src="/static/icons/arrow_more.png"></image>
</view>
</view>
<view class="orders-content-block" wx:if="{{item.is_show_type}}">
<view class="item-flex" wx:for="{{item.items.lists}}" wx:key="lists" wx:for-item="citem">
<view class="item-flex-title">{{citem.semester.subtitle}}({{citem.name}})</view>
<view class="item-flex-value">¥{{citem.price}}</view>
</view>
</view>
<view class="orders-content-item">
<label>支付金额</label>
<view class="nowrap">¥{{item.price}}</view>
</view>
<view class="orders-content-item">
<label>下单时间</label>
<view class="nowrap">{{item.created_at}}</view>
</view>
<view class="orders-content-item" wx:if="{{item.paid_at != ''}}">
<label>支付时间</label>
<view class="nowrap">{{item.paid_at}}</view>
</view>
</view>
<view class="orders-flex">
<view class="btns">
<view class="btns-item btns-border" wx:if="{{item.status == 0}}" bindtap="onCancel" data-id="{{item.order_id}}">取消</view>
<view class="btns-item btns-border" wx:if="{{item.status == 0}}" bindtap="onPay" data-item="{{item}}">支付</view>
<view class="btns-item" bindtap="onShowUsers" data-items="{{item.items}}">报名信息</view>
</view>
</view>
</view>
<view class="pagesLoding" wx:if="{{lodingStats}}">
<block wx:if="{{page.has_more}}">
<image class="pagesLoding-icon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
</block>
</view>
</view>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/text_null.png"></image>
<view>暂无数据</view>
</view>
<!-- 弹出报名人信息 -->
<view class="users-back {{usersShow ? 'active' : ''}}"></view>
<view class="users-content {{usersShow ? 'active' : ''}}">
<view class="users-title">报名信息<image class="users-content-icon" bindtap="usersHide" src="/static/icons/close.png"></image></view>
<view class="users-lists">
<view class="users-lists-item" wx:for="{{users}}" wx:key="index">
<view class="users-item nowrap"><label>报名姓名</label>{{item.name}}</view>
<view class="users-item nowrap"><label>报名手机</label>{{item.mobile}}</view>
<view class="users-item nowrap"><label>课程名称</label>{{item.semester.subtitle}}</view>
<view class="users-item nowrap"><label>签到状态</label><text class="bold">{{item.status_text}}</text></view>
<view class="users-item"><label>课程地址</label>{{item.semester.address}}</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,271 @@
.content {
background: #f7f8f9;
min-height: calc(100vh - 44px);
}
/* 订单弹出层 */
.users-back {
position: fixed;
height: 100vh;
width: 100%;
left: 0;
bottom: 0;
z-index: 100;
background-color: rgba(0, 0, 0, .4);
display: none;
}
.users-back.active {
display: block;
}
.users-content {
position: fixed;
height: 80vh;
width: 100%;
left: 0;
bottom: 0;
z-index: 101;
background-color: white;
display: none;
}
.users-content.active {
display: block;
}
.users-title {
text-align: center;
font-weight: bold;
font-size: 40rpx;
color: #333;
height: 70rpx;
line-height: 70rpx;
padding: 30rpx;
position: relative;
}
.users-content-icon {
position: absolute;
right: 30rpx;
top: 44rpx;
width: 40rpx;
height: 40rpx;
}
.users-lists {
padding: 0 30rpx 50rpx;
max-height: 70vh;
overflow-y: scroll;
}
.users-lists-item {
background: #f7f8f9;
padding: 30rpx;
border-radius: 20rpx;
font-size: 30rpx;
margin-bottom: 30rpx;
}
.users-item {
position: relative;
line-height: 45rpx;
min-height: 45rpx;
padding-left: 160rpx;
margin: 5rpx 0;
text-align: right;
}
.users-item label {
position: absolute;
left: 0;
top: 0;
color: gray;
}
.users-item .bold {
font-weight: bold;
color: #da2b56;
}
/* 订单筛选 */
.screen-flex {
display: flex;
flex-wrap: wrap;
position: fixed;
width: 100%;
left: 0;
top: 0;
height: 90rpx;
background-color: white;
z-index: 99;
}
.screen-picker {
width: 50%;
text-align: center;
}
.screen-text {
line-height: 90rpx;
height: 90rpx;
display: inline-block;
font-size: 30rpx;
}
.screen-icon {
margin-left: 5rpx;
width: 34rpx;
height: 34rpx;
vertical-align: -6rpx;
}
/* 订单为空 */
.order-null {
height: 80vh;
display: flex;
justify-content: center;
align-items: center;
}
/* 订单列表 */
.orders {
padding: 30rpx 0 10rpx;
margin-top: 90rpx;
}
.orders-item {
margin: 0 30rpx 20rpx;
background-color: white;
border-radius: 20rpx;
}
.orders-content {
padding: 20rpx 30rpx;
}
.orders-content-item {
line-height: 70rpx;
display: flex;
justify-content: space-between;
font-size: 30rpx;
color: #111111;
}
.orders-content-item label {
color: #999999;
}
.orders-content .orders-content-bottom {
padding-right: 30rpx;
position: relative;
}
.orders-content-type {
display: flex;
}
.orders-content-icon {
width: 20rpx;
height: 20rpx;
margin-top: 26rpx;
transition: .3s;
}
.orders-content-icon.active {
transform: rotate(90deg);
}
.orders-content-icon {
position: absolute;
right: 0;
top: 0;
}
.orders-content-block {
background: rgba(68, 110, 254, .03);
padding: 20rpx;
font-size: 28rpx;
border-radius: 10rpx;
margin: 10rpx 0;
}
.item-flex {
display: flex;
justify-content: space-between;
line-height: 50rpx;
}
.orders-flex {
border-bottom: solid 1rpx #F6F6F6;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
}
.orders-flex:last-child {
border-top: solid 1rpx #F6F6F6;
border-bottom: none;
}
.orders-tag {
display: inline-block;
background: #da2b56;
font-size: 26rpx;
color: white;
border-radius: 10rpx;
padding: 0 10rpx;
height: 40rpx;
line-height: 40rpx;
margin-right: 10rpx;
}
.orders-tag.order-tag-my {
background: #da2b56;
}
.no {
font-size: 30rpx;
color: #111;
line-height: 60rpx;
width: calc(100% - 150rpx);
}
.state {
color: #da2b56;
font-weight: bold;
font-size: 30rpx;
line-height: 60rpx;
width: 150rpx;
text-align: right;
}
.btns {
text-align: right;
width: 100%;
}
.btns-item {
display: inline-block;
height: 70rpx;
line-height: 70rpx;
background: #da2b56;
color: white;
border-radius: 35rpx;
padding: 0 30rpx;
font-size: 30rpx;
}
.btns-item.btns-border {
line-height: 68rpx;
box-sizing: border-box;
border: solid 1rpx #da2b56;
background: white;
color: #da2b56;
margin-right: 20rpx;
}
.pack-center {
z-index: 0;
}

66
pages/empower/index.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/empower/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

3
pages/empower/index.json Normal file
View File

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

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

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

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

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

View File

@@ -0,0 +1,76 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
popupShow : false,
code : '',
vouchers : [],
layIndex : 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
code: options.scene
})
this.codesInfo();
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 核销列表
*/
codesInfo() {
wx.$api.empower.codes({
code: this.data.code
}).then(res => {
this.setData({
vouchers: res.data
})
}).catch(err => {})
},
/**
* 报名信息弹出关闭
*/
usersHide() {
this.setData({
popupShow: false
})
},
// 显示确认弹出层
onShowLay(e){
let index = e.currentTarget.dataset.index
this.setData({
layIndex : index,
popupShow: true
})
},
// 签到
onSign(e){
let id = e.currentTarget.dataset.id
wx.$api.empower.sign({
item_id: id
}).then(res => {
this.setData({
popupShow: false
})
this.codesInfo();
}).catch(err => { })
}
})

View File

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

View File

@@ -0,0 +1,72 @@
<view class="content">
<!-- 核销凭证列表 -->
<block wx:if="{{vouchers.length > 0}}">
<view class="vouchers" wx:for="{{vouchers}}" wx:key="vouchers">
<image class="vouchers-icon" src="/static/icons/sign.png" mode="widthFix" wx:if="{{!item.can_sign}}"></image>
<view class="vouchers-info">
<view class="vouchers-info-item title">{{item.empower.title}}(第{{item.semester.no}}期)</view>
<view class="vouchers-info-item">报名人:{{item.name}}</view>
<view class="vouchers-info-item">有效期:{{item.semester.end}}</view>
</view>
<view class="vouchers-btns">
<view class="vouchers-btn" bindtap="onShowLay" data-index="{{index}}">{{item.can_sign ? '立即使用': '查看凭证'}}</view>
</view>
</view>
</block>
<view class="pack-center pages-hint" wx:else>
<image src="/static/imgs/text_null.png"></image>
<view>暂无数据</view>
</view>
<!-- 核销弹出层 -->
<view class="lay-back {{popupShow ? 'active' : ''}}"></view>
<view class="lay-info {{popupShow ? 'active' : ''}}">
<block wx:if="{{vouchers.length > 0}}">
<view class="lay-title">报名信息<image class="lay-title-icon" bindtap="usersHide" src="/static/icons/close.png"></image></view>
<view class="lay-content">
<view class="lay-item">
<label>报名课程</label>
<view class="lay-item-val">{{vouchers[layIndex].empower.title}}</view>
</view>
<view class="lay-item">
<label>学期名称</label>
<view class="lay-item-val">{{vouchers[layIndex].empower.subtitle}}</view>
</view>
<view class="lay-item">
<label>报名姓名</label>
<view class="lay-item-val">{{vouchers[layIndex].name}}</view>
</view>
<view class="lay-item">
<label>报名电话</label>
<view class="lay-item-val">{{vouchers[layIndex].mobile}}</view>
</view>
<view class="lay-item">
<label>开始时间</label>
<view class="lay-item-val">{{vouchers[layIndex].semester.start}}</view>
</view>
<view class="lay-item">
<label>结束时间</label>
<view class="lay-item-val">{{vouchers[layIndex].semester.end}}</view>
</view>
<view class="lay-item">
<label>课程地点</label>
<view class="lay-item-val">{{vouchers[layIndex].semester.address}}</view>
</view>
</view>
<view class="lay-border"></view>
<view class="lay-content">
<view class="lay-item">
<label>签到状态</label>
<view class="lay-item-val bold">{{vouchers[layIndex].can_sign ? '未签到': '已签到'}}</view>
</view>
<view class="lay-item" wx:if="{{!vouchers[layIndex].can_sign}}">
<label>签到时间</label>
<view class="lay-item-val">{{vouchers[layIndex].sign_at}}</view>
</view>
</view>
<view class="lay-btns">
<button class="lay-btn" disabled="{{!vouchers[layIndex].can_sign}}" bindtap="onSign" data-id="{{vouchers[layIndex].item_id}}">{{vouchers[layIndex].can_sign ? '签到': '已签到'}}</button>
</view>
</block>
</view>
</view>

View File

@@ -0,0 +1,194 @@
page {
background-color: #f7f7f7;
padding: 30rpx;
box-sizing: border-box;
}
/* 票券 */
.vouchers {
background: white;
border-radius: 20rpx;
margin-bottom: 30rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
position: relative;
}
.vouchers-icon {
position: absolute;
width: 100rpx;
height: 100rpx;
z-index: 1;
top: 15%;
left: 53%;
opacity: .5;
}
.vouchers-info {
position: relative;
padding: 20rpx 30rpx;
font-size: 28rpx;
border-right: dashed 2rpx #ddd;
width: calc(100% - 200rpx);
box-sizing: border-box;
}
.vouchers-info::after,
.vouchers-info::before {
content: " ";
height: 22rpx;
width: 22rpx;
background: #f7f7f7;
position: absolute;
right: -11rpx;
border-radius: 50%;
}
.vouchers-info::after {
top: -11rpx;
}
.vouchers-info::before {
bottom: -11rpx;
}
.vouchers-info-item {
line-height: 40rpx;
font-size: 26rpx;
color: gray;
}
.vouchers-info-item.bold {
font-weight: bold;
}
.vouchers-info-item.title {
font-size: 30rpx;
margin-bottom: 10rpx;
font-weight: bold;
color: #333;
}
.vouchers-btns {
width: 200rpx;
text-align: center;
}
.vouchers-btn {
background: #da2b56;
color: white;
line-height: 60rpx;
border-radius: 30rpx;
width: 150rpx;
font-size: 26rpx;
display: inline-block;
}
/* 核销凭证弹出层 */
.lay-back {
top: 0;
left: 0;
position: fixed;
width: 100vw;
height: 100vh;
z-index: 998;
background-color: rgba(0, 0, 0, .5);
display: none;
}
.lay-back.active {
display: block;
}
.lay-info {
width: 100vw;
box-sizing: border-box;
padding-bottom: 50rpx;
position: fixed;
left: 0;
bottom: 0;
z-index: 999;
background-color: #ffffff;
display: none;
transition: .2s;
height: 65vh;
overflow-y: scroll;
}
.lay-info.active {
display: block;
}
.lay-title {
font-size: 40rpx;
font-weight: bold;
text-align: center;
color: #333;
line-height: 60rpx;
padding: 50rpx;
position: relative;
}
.lay-title-icon {
position: absolute;
right: 30rpx;
top: 44rpx;
width: 40rpx;
height: 40rpx;
}
.lay-content {
padding: 0 40rpx;
}
.lay-item {
display: flex;
justify-content: space-between;
font-size: 30rpx;
padding: 10rpx 0;
line-height: 40rpx;
}
.lay-item label {
color: gray;
width: 160rpx;
}
.lay-item-val {
width: calc(100% - 160rpx);
}
.lay-item-val.bold {
color: #da2b56;
font-weight: bold;
}
.lay-border {
border-bottom: dashed 2rpx #ddd;
margin: 40rpx 0;
}
.lay-btns {
padding: 40rpx;
}
button.lay-btn {
width: 100%;
margin: 0;
background: #da2b56;
color: white;
height: 90rpx;
line-height: 90rpx;
padding: 0;
border-radius: 45rpx;
}
button.lay-btn ::after {
display: none;
}
button.lay-btn [disabled] {
opacity: .7;
}

View File

@@ -19,10 +19,12 @@ Page({
freight : '', // 运费
weight : '', // 重量
distribution : [
{ type: 2, title: "请选择配送方式" },
{ type: 0, title: "快递" },
{ type: 1, title: "自提" },
],
distributionIndex: 0
distributionIndex: 0,
distributionType : 2,
},
/**
@@ -42,7 +44,8 @@ Page({
distributionChange(e){
if(e.detail.value === this.data.distributionIndex) return
this.setData({
distributionIndex: e.detail.value
distributionIndex : e.detail.value,
distributionType : this.data.distribution[e.detail.value].type
})
this.placeInfo(this.data.skuId, this.data.goodsQty);
},
@@ -80,6 +83,13 @@ Page({
* 商品确认下单
*/
buyTap() {
if(this.data.distributionIndex == 0){
wx.showToast({
title: '请选择配送方式',
icon : 'none'
})
return
}
wx.showLoading({
title: '下单中...',
mask : true
@@ -88,7 +98,7 @@ Page({
goods_sku_id : this.data.skuId,
qty : this.data.goodsQty,
address_id : this.data.address.address_id,
delivery_type : this.data.distributionIndex
delivery_type : this.data.distributionType
}).then(res => {
wx.redirectTo({
url: '/pages/pay/index?params=' + encodeURIComponent(JSON.stringify(res.data))

View File

@@ -1,5 +1,5 @@
<!-- 地址 -->
<view class="address" wx:if="{{distributionIndex == 0}}">
<view class="address" wx:if="{{distributionIndex == 1}}">
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress&skuid={{skuId}}&qty={{goodsQty}}" class="address-cont" wx:if="{{address}}">
<view class="address-top">
<view class="address-area">

View File

@@ -138,9 +138,12 @@ Page({
this.setData({
[temp1]: valueid
})
let newlist = []
let str = ''
for (var i in this.data.specselect) {
console.log(this.data.specselect)
if (i == index) {
newlist.push(valueid);
if (i == 0) {
@@ -164,6 +167,8 @@ Page({
})
break;
}
console.log(this.data.selectSkusValues)
}
this.setData({
specselect: newlist
@@ -296,6 +301,16 @@ Page({
})
return
}
// 是否有推荐人
if(!this.data.goodsData.has_parent) {
this.setData({
isParent : true,
goodsSize : false
})
return
}
wx.showLoading({
title: '加载中...',
mask : true

View File

@@ -19,6 +19,8 @@ Page({
buy_sku_id : false,// 身份包产品
can_buy : false,// 是否可购买
certification : false,// 是否已认证
empowerArr : [] // 增收赋能
},
/**
@@ -55,6 +57,20 @@ Page({
// 获取身份包产品
this.getidpackage()
// 增收赋能接口
this.getEmpower()
},
/**
* 增收赋能接口
*/
getEmpower(){
wx.$api.empower.lists().then(res => {
this.setData({
empowerArr: res.data
})
})
},
/**
@@ -189,6 +205,21 @@ Page({
})
},
/**
* 查看增收赋能详情
*/
onEmpower(e){
if(wx.getStorageSync("token") != ''){
wx.navigateTo({
url: '/pages/empower/empowerInfo/empowerInfo?id=' + e.currentTarget.dataset.id
})
return
}
wx.navigateTo({
url: "/pages/login/index"
})
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/

View File

@@ -117,6 +117,7 @@
</scroll-view>
</view>
<!-- 商品 -->
<view class="goods">
<view class="goodsList" wx:if="{{goodsArr.length > 0}}">
<navigator hover-class="none" url="./details/details?id={{item.goods_id}}" class="goodsItem" wx:for="{{goodsArr}}" wx:key="goodsArr">
@@ -137,7 +138,7 @@
<image class="pagesLoding-icon" src="/static/icons/refresh_loding.gif" mode="widthFix"></image>加载中...
</block>
<block wx:else>
没有更多了~
<!-- 没有更多了~ -->
</block>
</view>
</view>
@@ -146,3 +147,20 @@
<view>暂无商品</view>
</view>
</view>
<!-- 增收赋能 -->
<view class="module" wx:if="{{empowerArr.length > 0}}">
<view class="module-title">
增收赋能类
</view>
<view class="enable-scroll">
<view class="enable-label" wx:for="{{empowerArr}}" wx:key="empowerArr" bindtap="onEmpower" data-id="{{item.id}}">
<image class="enable-img" src="{{item.cover}}" alt="" mode="widthFix"></image>
<view class="enable-cont">
<view class="nowrap enable-title">{{item.title}}</view>
<view class="nowrap enable-text">{{item.sub_title}}</view>
<view class="enable-price">¥{{item.price}}/年</view>
</view>
</view>
</view>
</view>

View File

@@ -266,6 +266,7 @@ page {
.goodsList {
flex-wrap: wrap;
justify-content: flex-start;
margin: 0 -10rpx;
}
.goodsItem {
@@ -331,3 +332,54 @@ page {
padding: 30rpx 30rpx 60rpx;
box-sizing: border-box;
}
/* 增收赋能 */
.module {
padding: 30rpx;
box-sizing: border-box;
}
.module-title {
margin-bottom: 20rpx;
color: #000000;
font-size: 32rpx;
font-weight: 600;
}
.enable-label {
background-color: #ffffff;
padding: 20rpx;
box-sizing: border-box;
border-radius: 20rpx;
position: relative;
margin-bottom: 30rpx;
}
.enable-img {
width: 200rpx;
border-radius: 20rpx;
}
.enable-cont {
position: absolute;
left: 0;
top: 0;
padding: 20rpx 20rpx 20rpx 240rpx;
box-sizing: border-box;
}
.enable-title {
font-size: 34rpx;
margin: 10rpx 0 15rpx;
}
.enable-price {
font-size: 36rpx;
color: #f0115c;
font-weight: 600;
}
.enable-text {
color: #999999;
margin: 10rpx 0 40rpx;
}

View File

@@ -30,8 +30,7 @@
<view class="shopSee-name"><image src="/static/icons/shop.png" mode="widthFix"></image>{{goodsData.shop.name}}</view>
<view class="shopSee-state reserve-status">{{goodsData.state}}</view>
</view>
<view class="list-goods">
<block wx:for="{{goodsData.items}}" wx:key="items">
<view class="list-goods" wx:for="{{goodsData.items}}" wx:key="items">
<image class="list-goods-img" mode="aspectFill" src="{{item.sku.cover}}"></image>
<view class="list-goods-cont">
<view class="nowrap list-goods-name">{{item.sku.goods_name}}</view>
@@ -42,7 +41,6 @@
¥<text>{{item.price}}</text>
</view>
</view>
</block>
</view>
</view>
<view class="While reserveCont">
@@ -69,7 +67,7 @@
</view>
<view class="reserve-label">
<view class="reserve-name">订单金额</view>
<view class="reserve-text">{{goodsData.amount}}</view>
<view class="reserve-text">{{goodsData.amount}}</view>
</view>
<view class="reserve-label">
<view class="reserve-name">实付金额</view>

View File

@@ -57,6 +57,7 @@ page {
.list-goods {
display: flex;
margin-bottom: 30rpx;
}
.list-goods-img {

View File

@@ -14,11 +14,13 @@ Page({
modelId : "",
modelType : "",
payType : "",
orderNos : [],
can : {
coin : 0,
wechat : 0,
},
loding : false
loding : false,
noShow : false
},
/**
@@ -31,12 +33,13 @@ Page({
mask : true
})
wx.$api.pay.info({ order_id, order_type }).then(res => {
let { can, total, model_type, model_id } = res.data
let { can, total, model_type, model_id, order_nos } = res.data
this.setData({
orderNo : order_no,
payType : res.data.default,
modelId : model_id,
modelType : model_type,
orderNos : order_nos,
total,
can
})
@@ -72,8 +75,40 @@ Page({
loding: false
})
break;
case 'baofoo':
this.baofuPay()
break;
}
},
/**
* 宝付微信
*/
baofuPay(){
wx.login({
success: wxCode => {
// wx.getFuzzyLocation({
// success: locationRes => {
// let { latitude, longitude } = locationRes
let { code } = wxCode;
let data = {
order_type : this.data.modelType,
order_id : this.data.modelId,
code : code,
longitude : '171.21',
latitude : '22.33',
}
wx.$api.pay.bfPay(data).then(res => {
console.log(res)
}).finally(() => {
this.setData({
loding: false
})
})
// }
// })
}
})
},
/**
* 微信支付
*/
@@ -108,5 +143,14 @@ Page({
})
}
})
},
/**
* 展开订单号
*/
noTap() {
this.setData({
noShow: !this.data.noShow
})
}
})

View File

@@ -3,7 +3,15 @@
<view class="info">
<view class="title">实付金额</view>
<view class="price"><text>¥</text>{{total}}</view>
<view class="no">订单号{{orderNo}}</view>
<view class="no">
<view class="no-title">支付金额包含订单</view>
<view class="no-list {{noShow ? 'active' : ''}}">
<view class="no-list-item" wx:for="{{orderNos}}" wx:key="order_nos">
<view class="no-list-item">订单号:{{item}}</view>
</view>
</view>
<view class="no-show {{noShow ? 'active' : ''}}" bindtap="noTap" wx:if="{{orderNos.length > 1}}">{{noShow ? '收起' : '展开'}} <image src="/static/icons/arrowWrite.png"></image></view>
</view>
</view>
<!-- 选择支付方式 -->
<view class="radio-title">选择支付方式</view>
@@ -23,6 +31,13 @@
</view>
<radio class="radio-radio" value="coin" color="#da2b54" checked="{{payType == 'coin'}}"/>
</label>
<label class="radio-flex" wx:if="{{can.baofoo == 1}}">
<view class="radio-text">
<image class="radio-icon" src="/static/pay/wechat.png"></image>
<text>微信支付(宝付)</text>
</view>
<radio class="radio-radio" value="baofoo" color="#da2b54" checked="{{payType == 'baofoo'}}"/>
</label>
</radio-group>
<view class="radio-lay" wx:if="{{loding}}"></view>
</view>

View File

@@ -1,10 +1,18 @@
.content{ background: white; min-height: 100vh; padding: 0 30rpx; }
.info{ padding:100rpx 50rpx; text-align: center; border-bottom: solid 1rpx #f7f8f9; }
.info{ padding:100rpx 20rpx; text-align: center; border-bottom: solid 1rpx #f7f8f9; }
.title{font-weight: bold; line-height: 40rpx;}
.price{ font-weight: bold; font-size: 80rpx; padding: 30rpx 0; line-height: 80rpx; }
.price text{ font-size: 80%; }
.no{ font-size: 28rpx; color: gray; line-height: 40rpx; }
.no{ font-size: 26rpx; color: gray; line-height: 40rpx; }
.no-list {margin-top: 30rpx; background-color: #f7faff; border-radius: 10rpx; padding: 30rpx 10rpx; box-sizing: border-box; height: 100rpx; position: relative; overflow: hidden;}
.no-list::after {position: absolute; left: calc(50% - 9rpx); top: -18rpx; content: ''; width: 0;height: 0;border-bottom: 18rpx solid #f7faff; border-left: 18rpx solid transparent; border-right: 18rpx solid transparent;}
.no-list-item {line-height: 40rpx; margin-bottom: 30rpx;}
.no-list-item:last-child {margin-bottom: 0;}
.no-list.active {height: auto;}
.no-show {background-color: #f7faff; color: #000000; display: inline-block; padding: 0 40rpx; line-height: 52rpx; border-radius: 0 0 10rpx 10rpx; font-size: 26rpx;}
.no-show image {width: 24rpx; height: 24rpx; vertical-align: -4rpx;transform: rotate(270deg); transition: .2s;}
.no-show.active image {transform: rotate(90deg);}
/* 支付方式 */
.radio-title{ font-weight: bold; font-size: 30rpx; padding: 30rpx; }

View File

@@ -1,4 +1,3 @@
// pages/sign/sign.js
Page({
/**
@@ -11,56 +10,56 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
onShareAppMessage: function () {
}
})

View File

@@ -1,2 +1 @@
<!--pages/sign/sign.wxml-->
<text>pages/sign/sign.wxml</text>
<view></view>

View File

@@ -1 +0,0 @@
/* pages/sign/sign.wxss */

66
pages/store/store.js Normal file
View File

@@ -0,0 +1,66 @@
// pages/store/store.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

4
pages/store/store.json Normal file
View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "自提门店"
}

21
pages/store/store.wxml Normal file
View File

@@ -0,0 +1,21 @@
<view class="content">
<view class="store-city">当前所在城市:哈尔滨市</view>
<view class="store-title">请选择自提门店</view>
<view class="store-list">
<view class="store-item">
<view class="store-item-title">华鸿国际自提点</view>
<view class="store-item-address">黑龙江省哈尔滨市南岗区闽江路73号</view>
<view class="store-item-km">距离1.0KM</view>
</view>
<view class="store-item">
<view class="store-item-title">闽江路自提点</view>
<view class="store-item-address">黑龙江省哈尔滨市南岗区闽江路10号</view>
<view class="store-item-km">距离1.0KM</view>
</view>
<view class="store-item">
<view class="store-item-title">金马国际自提点</view>
<view class="store-item-address">黑龙江省哈尔滨市南岗区嵩山路1号嵩山路珠江路交口</view>
<view class="store-item-km">距离1.0KM</view>
</view>
</view>
</view>

17
pages/store/store.wxss Normal file
View File

@@ -0,0 +1,17 @@
/* 内容 */
.content{ background: #f7f8f9; min-height: 100vh; }
/* 所在城市 */
.store-city{ background: white; padding: 0 30rpx; line-height: 90rpx; font-size: 30rpx; }
/* 选择自提门店 */
.store-title{ background: #f7f8f9; padding: 20rpx 30rpx; font-size: 28rpx; color: gray; }
/* 自提点 */
.store-list{ padding: 20rpx 0; background-color: white; }
.store-item{ padding: 20rpx 30rpx; position: relative; padding-right: 200rpx; }
.store-item::after{ position: absolute; right: 0; bottom: 0; left: 30rpx; height: 1rpx; background: #ddd; content: " "; }
.store-item:last-child::after{ display: none; }
.store-item-title{ font-weight: bold; line-height: 50rpx; font-size: 32rpx; }
.store-item-address{ font-size: 28rpx; color: gray; line-height: 40rpx; }
.store-item-km{ position: absolute; right: 30rpx; font-size: 26rpx; color: gray; top: 50%; line-height: 40rpx; margin-top: -20rpx; }

View File

@@ -89,6 +89,13 @@
<view class="userCont">
<view class="white">
<view class="tool-list">
<view class="order-item" bindtap="userNav" data-url="/pages/empower/empowerOrder/empowerOrder">
<image class="tool-icon" src="/static/imgs/tool_00.png" mode="widthFix"></image>
<view class="order-label">增收赋能类</view>
<block wx:if="{{userLogin}}">
<view class="order--number tool--number" wx:if="{{userData.empower.count > 0}}">{{userData.empower.count}}</view>
</block>
</view>
<view class="order-item" bindtap="userNav" data-url="/pages/account/index">
<image class="tool-icon" src="/static/imgs/tool_05.png" mode="widthFix"></image>
<view class="order-label">我的账户</view>

View File

@@ -130,6 +130,12 @@ page {
border: 4rpx solid #ffffff;
}
.tool--number {
border-radius: 30rpx;
padding: 0 8rpx;
right: 30rpx;
}
.parent-user {
display: flex;
padding: 30rpx;

View File

@@ -36,7 +36,7 @@
"checkInvalidKey": true,
"disableUseStrict": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
"ignoreUploadUnusedFiles": false
},
"compileType": "miniprogram",
"condition": {},

View File

@@ -8,6 +8,13 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "自提点",
"pathName": "pages/store/store",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "购物车",
"pathName": "pages/bag/bag",

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/icons/shopIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

BIN
static/icons/sign.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
static/imgs/tool_00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB