diff --git a/api/api.js b/api/api.js
index 04a98f0..2d975d2 100644
--- a/api/api.js
+++ b/api/api.js
@@ -190,21 +190,15 @@ const config = {
method: 'POST',
showLoading: true,
},
- // 获取收藏列表
- queryCollectionList: {
- url: '/user/queryCollectionList',
- method: 'GET',
- showLoading: true,
- },
- // 添加购物车
- addShopcar: {
- url: '/user/addShopcar',
+ // 取消收藏
+ deleteCollection: {
+ url: '/user/deleteCollection',
method: 'POST',
showLoading: true,
},
- // 获取购物车列表
- queryShopcarList: {
- url: '/user/queryShopcarList',
+ // 获取收藏列表
+ queryCollectionList: {
+ url: '/user/queryCollectionList',
method: 'GET',
showLoading: true,
},
@@ -239,7 +233,18 @@ const config = {
method: 'GET',
showLoading: true,
},
-
+ // 添加购物车
+ addShopcar: {
+ url: '/wares/addShopcar',
+ method: 'POST',
+ showLoading: true,
+ },
+ // 获取购物车列表
+ queryShopcarList: {
+ url: '/wares/queryShopcarList',
+ method: 'GET',
+ showLoading: true,
+ },
}
diff --git a/components/list/h-list.vue b/components/list/h-list.vue
new file mode 100644
index 0000000..bc6c049
--- /dev/null
+++ b/components/list/h-list.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+ 未定义内容
+
+
+
+
+
+
+
+
+
diff --git a/manifest.json b/manifest.json
index 72c4c63..8f22c8d 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,5 +1,5 @@
{
- "name" : "unapp模板",
+ "name" : "遗产里的景徳镇",
"appid" : "__UNI__197A38F",
"description" : "",
"versionName" : "1.0.0",
diff --git a/pages_order/components/product/productList.vue b/pages_order/components/product/productList.vue
index 2441561..00c87b3 100644
--- a/pages_order/components/product/productList.vue
+++ b/pages_order/components/product/productList.vue
@@ -1,7 +1,10 @@
-
+
{{item.waresTitle}}
diff --git a/pages_order/components/product/submit.vue b/pages_order/components/product/submit.vue
index e874e59..ec4d274 100644
--- a/pages_order/components/product/submit.vue
+++ b/pages_order/components/product/submit.vue
@@ -2,21 +2,27 @@
-
-
- 分享
-
+
-
-
- 购物车
-
+ @click="$utils.navigateTo('/page_order/mine/cart')">
+
@@ -30,7 +36,7 @@
name:"submit",
props : {
submiitTitle : {
- default : '立即租赁',
+ default : '立即购买',
type : String,
}
},
diff --git a/pages_order/components/product/submitUnitSelect.vue b/pages_order/components/product/submitUnitSelect.vue
index 0480d1e..19f5e56 100644
--- a/pages_order/components/product/submitUnitSelect.vue
+++ b/pages_order/components/product/submitUnitSelect.vue
@@ -9,10 +9,10 @@
@click="openAddress">
- {{ address.name }}
+ {{ address.userName }}
- {{ address.addressDetail }}
+ {{ address.address }}
- ¥299元
+ ¥{{ detail.waresPrice }}元
请选择规格
@@ -47,35 +48,42 @@
-
+
-
+
- {{ submiitTitle }}
+
+ 加入租赁车
+
+
+ {{ submiitTitle }}
+
@@ -94,12 +102,15 @@
import addressList from '../address/addressList.vue'
export default {
components : {
- addressList
+ addressList,
},
props : {
submiitTitle : {
default : '立即租赁',
type : String,
+ },
+ detail : {
+ default : {}
}
},
data() {
@@ -111,12 +122,21 @@
},
num : 1,
unit : {},
+ addressTotal : 0,
}
},
methods: {
// 打开
open(){
this.$refs.popup.open('bottom')
+
+ // 获取地址列表
+ this.$refs.addressList.getAddressList().then(res => {
+ this.addressTotal = res.total
+ if(this.addressTotal != 0){
+ this.address = res.records[0]
+ }
+ })
},
// 关闭
close(){
@@ -124,6 +144,11 @@
},
// 打开选择地址
openAddress(){
+ if (this.addressTotal == 0) {
+ return uni.navigateTo({
+ url: '/pages_order/mine/address'
+ })
+ }
this.$refs.addressPopup.open('bottom')
},
// 选择地址
@@ -136,6 +161,68 @@
this.unit = item
this.unitIndex = index
},
+ addCart(){
+ this.$api('addShopcar', {
+ id : this.detail.id,
+ skuId : this.unit.id,
+ }, res => {
+ if(res.code == 200){
+ uni.showToast({
+ title: '添加成功',
+ });
+ this.$refs.popup.close()
+ }
+ })
+ },
+ orderPay(){
+
+ let data = {
+ id : this.detail.id,//商品id
+ skuId : this.unit.id,//规格id
+ addressId : this.address.id,//地址id
+ sku : this.unit.title,//规格
+ num : this.num,
+ }
+
+
+ if(this.$utils.verificationAll(data, {
+ skuId : '请选择规格',
+ addressId : '请选择地址',
+ })){
+ return
+ }
+
+ this.$api('orderPay', data, res => {
+ if(res.code == 200){
+
+ uni.redirectTo({
+ url: '/pages/index/order'
+ })
+
+ // uni.requestPayment({
+ // provider: 'wxpay', // 服务提提供商
+ // timeStamp: res.result.timeStamp, // 时间戳
+ // nonceStr: res.result.nonceStr, // 随机字符串
+ // package: res.result.packageValue,
+ // signType: res.result.signType, // 签名算法
+ // paySign: res.result.paySign, // 签名
+ // success: function (res) {
+ // console.log('支付成功',res);
+ // uni.redirectTo({
+ // url: '/pages/index/order'
+ // })
+ // },
+ // fail: function (err) {
+ // console.log('支付失败',err);
+ // uni.showToast({
+ // icon:'none',
+ // title:"支付失败"
+ // })
+ // }
+ // });
+ }
+ })
+ },
}
}
@@ -246,7 +333,6 @@
}
}
.submit-btn{
- background: $uni-color;
width: 600rpx;
height: 80rpx;
color: #fff;
@@ -256,6 +342,23 @@
display: flex;
justify-content: center;
align-items: center;
+ border: 1rpx solid $uni-color;
+ overflow: hidden;
+ .l{
+ flex: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: $uni-color;
+ }
+ .r{
+ background: $uni-color;
+ flex: 1;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
}
}
diff --git a/pages_order/mine/collect.vue b/pages_order/mine/collect.vue
index efb3ccf..82ff695 100644
--- a/pages_order/mine/collect.vue
+++ b/pages_order/mine/collect.vue
@@ -1,6 +1,6 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.roleName }}
+
+
+ {{ item.preTime || '提前一周预约' }}
+
+
+ {{ item.preInfo}}
+
+
+
+ ¥{{ item.price }}起
+
+
+ ¥线上预约
+
+
+
+
+
+
+
-
diff --git a/pages_order/product/productDetail.vue b/pages_order/product/productDetail.vue
index 6db8895..6898561 100644
--- a/pages_order/product/productDetail.vue
+++ b/pages_order/product/productDetail.vue
@@ -58,7 +58,7 @@
-
+
@@ -80,6 +80,12 @@
this.productId = args.id
this.queryWaresById()
},
+ onShareAppMessage(res) {
+ return {
+ title: this.productDetail.waresTitle,
+ path: '/pages_order/product/productDetail?id=' + this.id
+ }
+ },
methods: {
// 分享商品
share() {
diff --git a/pages_order/service/reservationDetail.vue b/pages_order/service/reservationDetail.vue
index 201e244..5a0db23 100644
--- a/pages_order/service/reservationDetail.vue
+++ b/pages_order/service/reservationDetail.vue
@@ -169,11 +169,16 @@
methods: {
addCollection(){
this.$api('addCollection', {
- collectionItmeId : this.detail.id,
+ itemId : this.detail.id,
collectionType : this.collectType[this.type],
}, res => {
if(res.code == 200){
this.getData()
+
+ uni.showToast({
+ title: res.message,
+ icon:'none'
+ })
}
})
},