商品列表、详情、生成订单

lu_quan_dev
hehang 10 months ago
parent b06a49f812
commit 573c0076a4
  1. 19
      common/config.js
  2. 108
      subPageA/shop/shopDetail/shopDetail.vue
  3. 73
      subPageA/shop/shopList/shopList.vue
  4. 101
      subPageC/bookShop/bookShop.vue

@ -6,14 +6,15 @@
// const ROOTPATH = "http://192.168.110.113:8083";
const REAUEST_ROOTPATH = "https://eluyou.ailuquan.cn";
const ROOTPATH = "https://eluyou.ailuquan.cn";
const PWPATH = "https://eluyou.ailuquan.cn";
// const REAUEST_ROOTPATH = "https://eluyou.ailuquan.cn";
// const ROOTPATH = "https://eluyou.ailuquan.cn";
// const PWPATH = "https://eluyou.ailuquan.cn";
// 陈锋机子
// const REAUEST_ROOTPATH = "http://192.168.110.137:8083";
// const ROOTPATH = "http://192.168.110.137:8083";
// const PWPATH = "http://192.168.110.137:8083";
const REAUEST_ROOTPATH = "http://192.168.110.131:48080";
const ROOTPATH = "http://192.168.110.131:48080";
const PWPATH = "http://192.168.110.131:48080";
//票务根
// const PWPATH = "http://192.168.130.157:48080";
@ -207,4 +208,10 @@ module.exports = {
getHomestayOrderDetail: PWPATH +"/admin-api/homestay/HotelOrder/selectUserOrderOne", // 获取民宿订单详情信息
getHomestayOrderList: PWPATH + "/admin-api/homestay/HotelOrder/selectPageUser", // 获取用户全部民宿订单列表
getHomestayOrderRefund: PWPATH + "/admin-api/homestay/HotelOrder/getHotelRefundLog", // 获取用户民宿退款信息
//商品相关
selectAppGoodsPage: PWPATH + "/admin-api/homestay/merchantOrder/selectAppGoodsPage", // 获取商品列表
selectAppGoodsDetails: PWPATH + "/admin-api/homestay/merchantOrder/selectAppGoodsDetails", // 获取商品详情
createMerchantOrder: PWPATH + "/admin-api/homestay/merchantOrder/createMerchantOrder", // 生成商品订单
}

@ -13,13 +13,13 @@
<view class="v-shop-price row flex-align-center">
<text class="num-pre">&yen;</text>
<text class="num-price">{{info.price}}</text>
<text class="num-del col">&yen;{{info.original}}</text>
<text class="num-sell">已售 {{info.sell}}</text>
<text class="num-del col">&yen;{{info.marketPrice}}</text>
<text class="num-sell">已售 {{info.soldQuantity}}</text>
</view>
<view class="v-shop-name">{{info.shop}}</view>
<view class="v-shop-name">{{info.merchantName}}</view>
<view class="v-detail-name">
<view class="text inline-block">{{info.title}}</view>
<view class="v-detail-tip m-t-12"><text class="item">{{info.tip}}</text></view>
<view class="text inline-block">{{info.goodsName}}</view>
<view class="v-detail-tip m-t-12"><text class="item">文创产品</text></view>
</view>
</view>
<!-- 介绍 -->
@ -28,7 +28,7 @@
<view class="text"><text>商品详情</text></view>
</view>
<view class="v-detail-content m-t-24">
<u-parse :content="info.content" />
<u-parse :content="info.description" />
</view>
</view>
@ -54,68 +54,60 @@
//
pic_list: undefined,
info: {},
netType: true
netType: true,
id:1
};
},
onLoad: function(options) {
var that = this;
this.$util.getNetworkType(
function(res) {
if (res.networkType === 'none') {
uni.showToast({
title: that.$param.netMsg,
icon: "none",
duration: 2000
})
that.netType = false;
}
},
function() {
uni.showToast({
title: that.$param.netMsg,
icon: "none",
duration: 2000
})
that.netType = false;
}
)
if (!that.netType) {
return;
}
this.$util.hideLoadingByTime();
that.$util.saveOperatorLog(that, "SHOP", options.id);
// this.id = options.id
this.getInitPage();
},
methods: {
//
getInitPage: function(id) {
getInitPage: function() {
var that = this;
// var data = {
// "userkey": this.$param.userkey,
// "type": this.$param.methodType,
// "id": id
// }
// this.$Request.post(this.$config.getMessgeInfoDetailFormId, data).then(res => {
// if (!that.$util.isSuccess(res)) {
// return;
// }
// this.info = res.data;
// })
this.info = {
title: "网红非遗漆扇",
shop: "鹿泉区伞扇工艺店",
price: 98,
original: 125,
sell: 25,
tip: "文创产品",
content: "<p>酒店是石家庄西部定位为室外桃源,避世隐匿的新中式奢华酒店,酒店坐落于石家庄鹿泉区,周边是山林秀美的长青休博城。酒店拥有多功能厅</p>"
var data = {
"goodsId": this.id
}
this.pic_list = [
'http://img.alicdn.com/img/i4/43532943/O1CN01O6AwIA1Xbwde6yhlm_!!4611686018427380367-0-saturn_solar.jpg_580x580q90.jpg_.webp'
];
this.$Request.get(this.$config.selectAppGoodsDetails, data, '', '', false, false).then(res => {
this.info = res.data;
this.pic_list = res.data.picPhoto.split(",")
})
},
orderSubmit:function(){
/* this.judgeLogin((resa) => {
var data = {
openid: this.userInfo.openid,
shopId: this.info.id,
goodsName: this.info.goodsName,
price:this.info.price,
merchantId:this.info.merchantId,
merchantName:this.info.merchantName
};
const parame = {
...val,
...data
}
const shop = encodeURIComponent(JSON.stringify(parame));
uni.navigateTo({
url: "/subPageC/bookShop/bookShop?shop=" + shop
});
}); */
var data = {
shopId: this.info.id,
goodsName: this.info.goodsName,
price:this.info.price,
merchantId:this.info.merchantId,
merchantName:this.info.merchantName
};
uni.navigateTo({
url: "/subPageC/bookShop/bookShop?shop=" + data
});
}
}
};
</script>

@ -20,16 +20,16 @@
@click="gotoDetail(item)">
<view class="item_box">
<view class="item_image">
<image class="img" :src="item.img" mode="aspectFill"></image>
<image class="img" :src="item.picUrls" mode="aspectFill"></image>
</view>
<view class="item_content">
<view class="title">{{ item.name }}</view>
<view class="title">{{ item.goodsName }}</view>
<view class="tip"><text class="item">文创产品</text></view>
<view class="bottom row flex-align-center">
<text class="num-pre">&yen;</text>
<text class="num-price">{{ item.price }}</text>
<text class="num-del col">&yen;168</text>
<text class="num-sold">已售 20</text>
<text class="num-del col">&yen;{{item.marketPrice}}</text>
<text class="num-sold">已售 {{item.soldQuantity}}</text>
</view>
</view>
</view>
@ -69,7 +69,7 @@
noData: false,
loading: false,
finished: false,
title: undefined
goodsName: ""
},
};
},
@ -96,55 +96,16 @@
},
//
get_data() {
// this.$Request.get(this.$config.getMethodRecommendList, this.parames, '', '', false, '').then(res => {
// const curPageData = res.data || [] //
// if (this.mescroll.num == 1) this.data_list = []; //
// this.data_list = [...this.data_list, ...curPageData]
// setTimeout(() => {
// this.mescroll.endSuccess(curPageData.length); // ,
// }, 1000);
// }).catch(() => {
// this.mescroll.endErr(); // ,
// });
//
this.data_list = [{
img: 'https://g-search3.alicdn.com/img/bao/uploaded/i4/i1/683867002/O1CN01v7PEhx21ayD0gWe87_!!0-item_pic.jpg_580x580q90.jpg_.webp',
name: '白鹿白茶',
price: 158,
delPrice: 198,
sale: 58,
business: '稻香村河北总部基地',
tip: '文创产品'
},
{
img: 'http://img.alicdn.com/img/i4/43532943/O1CN01O6AwIA1Xbwde6yhlm_!!4611686018427380367-0-saturn_solar.jpg_580x580q90.jpg_.webp',
name: '稻香村糕点',
price: 158,
delPrice: 198,
sale: 58,
business: '稻香村河北总部基地',
tip: '文创产品'
},
{
img: 'https://picasso.alicdn.com/imgextra/O1CNA1LTOzeL1aFS2A69qYN_!!2218186693300-0-psf.jpg_580x580q90.jpg_.webp',
name: '文创小皮马包',
price: 158,
delPrice: 198,
sale: 58,
business: '稻香村河北总部基地',
tip: '文创产品'
},
{
img: 'https://g-search1.alicdn.com/img/bao/uploaded/i4/i4/3981021815/O1CN018ghXcs1PHJp2F8riD_!!0-item_pic.jpg_580x580q90.jpg_.webp',
name: '网红非遗漆扇',
price: 158,
delPrice: 198,
sale: 58,
business: '稻香村河北总部基地',
tip: '文创产品'
}
];
this.$Request.get(this.$config.selectAppGoodsPage, this.parames, '', '', false, false).then(res => {
const curPageData = res.data.list || [] //
if (this.mescroll.num == 1) this.data_list = []; //
this.data_list = [...this.data_list, ...curPageData]
setTimeout(() => {
this.mescroll.endSuccess(curPageData.length); // ,
}, 1000);
}).catch(() => {
this.mescroll.endErr(); // ,
});
},
//
gotoDetail(val) {
@ -153,14 +114,14 @@
});
},
write: function(e) {
this.parames.title = e.detail.value;
this.parames.goodsName = e.detail.value;
},
search: function() {
this.parames.pageno = 1;
this.get_data();
},
confirm(e) {
this.parames.title = e.detail.value;
this.parames.goodsName = e.detail.value;
this.parames.pageno = 1;
this.get_data();
},

@ -1,56 +1,26 @@
<template>
<view class="v-pages bgcolor p-b-24">
<view class="v-card order small container-fluid m-t-24" style="padding-bottom: 60rpx;">
<view class="v-order-form">
<view class="v-form-date row flex-align-center">
<view class="start"><text class="date">{{orderInfo.startDate1}}</text></view>
<text class="mid">{{orderInfo.dayNum}}</text>
<view class="end"><text class="date">{{orderInfo.endDate1}}</text></view>
</view>
<view class="v-order-title">
{{orderInfo.houseName}}
</view>
<view class="v-order-tip">
<!-- <text
v-if="orderInfo.bedNum">{{orderInfo.bedNum}}张床{{orderInfo.bedWide}}米宽{{orderInfo.houseNam}}</text> -->
<text v-if="orderInfo.guest">{{orderInfo.guest}}人入住</text> <text class="m-l-10"
v-if="orderInfo.houseArea">{{orderInfo.houseArea}}</text>
</view>
<view class="v-order-wait">需等待商家确认</view>
</view>
<view>{{orderInfo.goodsName}}</view><!-- 商品名称 -->
<view>{{orderInfo.price}}</view><!-- 单价 -->
<view>{{orderInfo.merchantId}}</view><!-- 商户id -->
<view>{{orderInfo.merchantName}}</view><!-- 商户名称 -->
</view>
<view class="v-card order small container-fluid m-t-24">
<view class="v-order-title m-b-24">
<view class="text"><text>入住信息</text></view>
<view class="text"><text>信息</text></view>
</view>
<uni-forms class="v-order-form" ref="form" :modelValue="formData">
<!-- 整套民宿预定暂时不显示房间数量 -->
<!-- <uni-forms-item label="房间数量" name="roomNumber">
<uni-easyinput class="v-input" type="number" :inputBorder="false" v-model="formData.roomNumber"
placeholder="请输入房间数量" />
</uni-forms-item> -->
<uni-forms-item label="入住人" name="name">
<uni-easyinput class="v-input" type="text" :inputBorder="false" placeholderStyle="fontSize:24rpx"
v-model="formData.name" placeholder="请输入入住人姓名" />
</uni-forms-item>
<uni-forms-item label="身份证号" name="idCardNumber">
<uni-forms-item label="联系人" name="name">
<uni-easyinput class="v-input" type="text" :inputBorder="false" placeholderStyle="fontSize:24rpx"
v-model="formData.idCardNumber" placeholder="请输入身份证号码" />
v-model="formData.name" placeholder="请输入联系人姓名" />
</uni-forms-item>
<uni-forms-item label="联系手机" name="phoneNumber">
<uni-forms-item label="联系电话" name="phoneNumber">
<uni-easyinput class="v-input" type="number" :inputBorder="false" placeholderStyle="fontSize:24rpx"
v-model="formData.phoneNumber" placeholder="请输入手机号码" />
</uni-forms-item>
</uni-forms>
</view>
<view class="v-card order small container-fluid m-t-24">
<view class="v-order-title">
<view class="text"><text>发票服务</text></view>
</view>
<view class="m-t-24 v-form-content">如需发票请向民宿前台索取</view>
</view>
<view class="v-card order small bg1 container-fluid m-t-24">
<view class="v-order-title">
<view class="text"><text>下单说明</text></view>
@ -91,40 +61,18 @@
orderInfo: {},
formData: {
name: undefined,
roomNumber: 1, //1
phoneNumber: undefined,
idtype: 1,
idCardNumber: undefined,
// phoneNumber: undefined,
// idtype: undefined,
// idCardNumber: undefined,
phoneNumber: undefined
},
orderPay: undefined,
totalPrice: undefined,
totalPrice: undefined, //
totalNum:undefined, //
rules: {
name: {
rules: [{
required: true,
errorMessage: '入住人姓名不能为空!',
errorMessage: '联系人姓名不能为空!',
}]
},
idCardNumber: {
rules: [{
required: true,
errorMessage: '身份证号码不能为空!',
},
{
validateFunction: function(rule, value, data, callback) {
const reg =
/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
if (reg.test(value) == false) {
callback('请输入正确的身份证号码!')
}
return true
}
}
]
},
phoneNumber: {
rules: [{
required: true,
@ -149,10 +97,8 @@
this.$refs.form.setRules(this.rules)
},
onLoad(options) {
const ticket = JSON.parse(decodeURIComponent(options.ticket));
this.orderInfo = ticket
this.totalPrice = Math.round(Number(this.orderInfo.housePrice) * Number(this.orderInfo.dayNum) * 100) / 100
this.formData.phoneNumber = this.orderInfo.mobile
const shop = JSON.parse(decodeURIComponent(options.shop));
this.orderInfo = shop
},
methods: {
orderSubmit() {
@ -162,22 +108,19 @@
let appId = extConfig.app_id
var data = {
"hotelId": this.orderInfo.hotelId,
"hotelName": this.orderInfo.hotelName,
"orderAmount": this.totalPrice,
"checkTime": this.orderInfo.startDate,
"checkOutTime": this.orderInfo.endDate,
"bedId": this.orderInfo.id,
"roomsNums": Number(this.formData.roomNumber),
"mobile": this.orderInfo.mobile,
"customerName":this.formData.name,
"customerPhone": this.formData.phoneNumber,
"openid": this.orderInfo.openid,
"appid": appId,
"tenantId": "1",
"checkInPersonInfoDTOList": [this.formData]
"merchantId":this.orderInfo.merchantId,
"merchantName":this.orderInfo.merchantName,
"orderAmount":this.totalPrice,
"goodsId":this.orderInfo.id,
"goodsNum":this.orderInfo.goodsNum
};
this.$Request.post(this.$config.createHotelOrder, data, 'json', null, false, true).then((
this.$Request.post(this.$config.createMerchantOrder, data, 'json', null, false, true).then((
res) => {
if (res.code == 0) {
this.orderPay = res.data

Loading…
Cancel
Save