4 Commits
170 changed files with 12391 additions and 18598 deletions
-3
View File
@@ -1,9 +1,7 @@
<script> <script>
import { clearAllInterval } from '@/utils/util'
export default { export default {
onLaunch: function () { onLaunch: function () {
console.log('App Launch') console.log('App Launch')
clearAllInterval()
}, },
onShow: function () { onShow: function () {
console.log('App Show') console.log('App Show')
@@ -25,5 +23,4 @@ export default {
@import "./assets/css/base.less"; @import "./assets/css/base.less";
@import "./assets/css/reset.less"; @import "./assets/css/reset.less";
@import "./assets/css/style.less"; @import "./assets/css/style.less";
@import "./assets/css/v12-style.less";
</style> </style>
-7
View File
@@ -68,11 +68,4 @@ export function getVideoList(page = 1, limit = 10) {
* */ * */
export function removeFavorite(ids) { export function removeFavorite(ids) {
return request.post('/collection/delete', ids) return request.post('/collection/delete', ids)
}
/**
* 收藏千县名品县城列表
* */
export function getCountyFamousList(page = 1, limit = 10) {
return request.get('/collection/countyFamous/list', {page, limit})
} }
+1 -17
View File
@@ -219,20 +219,4 @@ export function setTopHotelNew(data) {
return request.post("/api/hotelNews/setIsTop", data, { return request.post("/api/hotelNews/setIsTop", data, {
login: true login: true
}); });
} }
/**
* 店铺转发分享背景图片
* @param id 店铺ID int
* */
export function getHotelShareBackgroundImage(id) {
return request.get("/api/hotelMain/shareImage/" + id, {}, {login: true})
}
/**
* 店铺资讯
* @param id 店铺资讯ID int
* */
export function hotelNewsView(data) {
return request.post("/api/hotelNews/view", data, {login: true})
}
-7
View File
@@ -28,11 +28,4 @@ export function takePrize(lotteryRecordId){
* */ * */
export function getLogs(page = 1, limit = 10) { export function getLogs(page = 1, limit = 10) {
return request.get('/lottery/dice/records',{page,limit}) return request.get('/lottery/dice/records',{page,limit})
}
/**
* 抽奖活动分享
* */
export function getLotteryShareInfo() {
return request.get('/lottery/shareImage')
} }
-18
View File
@@ -160,22 +160,4 @@ export function orderVerific(verifyCode, isConfirm) {
// 延迟收货 // 延迟收货
export function orderDelay(uni) { export function orderDelay(uni) {
return request.post("/order/extendedDelivery", {uni}) return request.post("/order/extendedDelivery", {uni})
}
/**
* 再买一单
* @param {*} params
* @returns
*/
export function aginConfirm(params) {
return request.post('/order/buyAgainConfirm', params)
}
/**
* 修改地址
* @param {*} params
* @returns
*/
export function editAddress(params) {
return request.post('/order/editAddress', params)
} }
-39
View File
@@ -78,10 +78,6 @@ export function getHomestay(id) {
return request.get(`/contentHomestay/${id}`, {}, {login: false}) return request.get(`/contentHomestay/${id}`, {}, {login: false})
} }
export function getHomestayV2(id) {
return request.get(`/contentHomestay/v2/${id}`, {}, {login: false})
}
/** /**
* 节日专题 * 节日专题
* */ * */
@@ -89,17 +85,6 @@ export function getFestival() {
return request.get('/contentFestival', {}, {login: false}) return request.get('/contentFestival', {}, {login: false})
} }
export function getFestivalV2() {
return request.get('/contentFestival/v2', {}, {login: false})
}
/**
* 尖货专题
* */
export function getContentBest(id) {
return request.get(`/contentBest/${id}`, {}, {login: false})
}
/* /*
* 非遗文化 * 非遗文化
* */ * */
@@ -131,28 +116,4 @@ export function getProvince(id) {
export function getProvinceGoods(parentId, keyword, page) { export function getProvinceGoods(parentId, keyword, page) {
const params = `?parentId=${parentId}&keyword=${keyword}&page=${page}&limit=10`; const params = `?parentId=${parentId}&keyword=${keyword}&page=${page}&limit=10`;
return request.get('/landmarkGoods/productList' + params, {}, {login: false}) return request.get('/landmarkGoods/productList' + params, {}, {login: false})
}
export function getPorjectRecommend(params) {
return request.get('/landmarkGoods/hotelList', params, {login: false})
}
export function getPorjectPolicyFiles(params) {
return request.get('/landmarkGoods/policyFiles', params, {login: false})
}
export function getCulture(params) {
return request.get('/landmarkGoods/culture', params, {login: false})
}
export function getNews(params) {
return request.get('/landmarkGoods/news', params, {login: false})
}
export function hadLike(data) {
return request.post('/landmarkGoods/news/zan', data, {login: false})
}
export function hadView(data) {
return request.post('/landmarkGoods/news/view', data, {login: false})
} }
+2 -6
View File
@@ -8,8 +8,8 @@ export function getSplashScreen() {
* 首页 * 首页
* @returns {*} * @returns {*}
*/ */
export function getHomeData(params) { export function getHomeData() {
return request.get("index", params, { return request.get("index", {}, {
login: false login: false
}); });
} }
@@ -207,8 +207,4 @@ export function getShareImage() {
export function getXiaoZhi() { export function getXiaoZhi() {
return request.get("/appAdvertising", {}, {login: false}) return request.get("/appAdvertising", {}, {login: false})
}
export function pushSystemStatic(data) {
return request.post("/systemStats/push", data, { login: false })
} }
-96
View File
@@ -1,96 +0,0 @@
import request from '@/utils/request'
// 千县名品首页
export function getCountyFamousIndex() {
return request.get('/countyFamous/index', {}, { login: true })
}
// 获取千县名品省-县树形列表
export function getCountyFamousCityTree(param) {
return request.get('/countyFamous/cityTree', param, { login: true })
}
// 获取千县名品县城数据
export function getCountyFamousCityDetail(id) {
return request.get('/countyFamous/' + id, {}, { login: true })
}
// 获取千县名品县城店铺数据
export function getCountyFamousCityShop(param) {
return request.get('/countyFamous/shop', param, { login: true })
}
// 千县名品店铺点赞/取消赞
export function postCountyFamousShopZan(data) {
return request.post('/countyFamous/shop/zan', data, { login: true })
}
// 千县名品店铺点赞/取消赞
export function postCountyFamousShopAddFavorite(data) {
return request.post('/collection/countyFamous/add', data, { login: true })
}
// 千县名品店铺点赞/取消赞
export function postCountyFamousShopRemoveFavorite(data) {
return request.post('/collection/countyFamous/remove', data, { login: true })
}
// 千县名品资讯点赞/取消赞
export function postCountyFamousNewsZan(data) {
return request.post('/countyFamous/news/zan', data, { login: true })
}
// 千县名品资讯被浏览
export function postCountyFamousNewsView(data) {
return request.post('/countyFamous/news/view', data, { login: true })
}
// 获取千县名品县城资讯数据
export function getCountyFamousCityNews(param) {
return request.get('/countyFamous/news', param, { login: true })
}
// 获取千县名品县城攻略数据
export function getCountyFamousCityGuide(param) {
return request.get('/countyFamous/guide', param, { login: true })
}
// 获取千县名品县城攻略专题页
export function getCountyFamousCityGuideContent(param) {
return request.get('/countyFamous/guide/content', param, { login: true })
}
// 获取千县名品县城重点产业列表
export function getCountyFamousIndustry(param) {
return request.get('/countyFamous/industry', param, { login: true })
}
// 获取千县名品县城产业项目列表
export function getCountyFamousIndustryProject(param) {
return request.get('/countyFamous/industryProject', param, { login: true })
}
// 获取千县名品县城产业项目文件列表
export function getCountyFamousIndustryProjectFile(param) {
return request.get('/countyFamous/industryProject/file', param, { login: true })
}
// 获取千县名品县城招商政策文件列表
export function getCountyFamousInvestmentFile(param) {
return request.get('/countyFamous/investmentFile', param, { login: true })
}
// 获取千县名品县城村屋列表
export function getCountyFamousVillage(param) {
return request.get('/countyFamous/village', param, { login: true })
}
// 获取千县名品县城村屋详情
export function getCountyFamousVillageDetail(id) {
return request.get('/countyFamous/village/' + id, {}, { login: true })
}
// 获取千县名品县城村屋资讯
export function getCountyFamousVillageNews(param) {
return request.get('/countyFamous/village/news', param, { login: true })
}
-28
View File
@@ -25,15 +25,6 @@ export function getProductDetail(id, data) {
}); });
} }
/*
* 商品规格选中
* */
export function getProductSkuBySelected(data) {
return request.post("/product/getSkuBySelected", data, {
login: true
});
}
/* /*
* 商品分销二维码 * 商品分销二维码
* */ * */
@@ -153,20 +144,6 @@ export function changeCartNum(id, number) {
}); });
} }
/*
* 购物车 获取商品规格
* */
export function getCartGoodAttr(id, uniqueId) {
return request.get(`/product/attr/${id}?uniqueId=${uniqueId}`)
}
/*
* 购物车 商品规格修改
* */
export function cartGoodChangeAttr(data) {
return request.post('/cart/changeAttr', data)
}
/** /**
* 搜索推荐关键字 * 搜索推荐关键字
*/ */
@@ -219,8 +196,3 @@ export function storeListApi(data) {
login: false login: false
}); });
} }
// 商品列表
export function getHotels(param) {
return request.get('/api/hotelMain/search', param, { login: false })
}
-47
View File
@@ -273,13 +273,6 @@ export function postAddress(data) {
return request.post("/address/edit", data); return request.post("/address/edit", data);
} }
/*
* 自动识别收货地址
* */
export function analysisAddress(data) {
return request.post("/address/analysis", data);
}
/* /*
* 获取收藏产品 * 获取收藏产品
* */ * */
@@ -546,43 +539,3 @@ export function getRechargeApi() {
export function getUserCenterBanner() { export function getUserCenterBanner() {
return request.get("userCenterBanner"); return request.get("userCenterBanner");
} }
/*
* 用户积分信息
*/
export function getUserPointInfo(param) {
return request.get('/user/points/info', param, { login: true })
}
/*
* 用户积分记录
*/
export function getUserPointBill(param) {
return request.get('/user/points/bill', param, { login: true })
}
/*
* 用户分销说明
*/
export function getUserSpreadRule(param) {
return request.get('/userSpreadRule', param, { login: false })
}
/**
* 我的足迹
* @param {*} params
* @returns
*/
export function getHistory(params) {
return request.get('/history/list', params)
}
/**
* 购物车猜你喜欢
* @param {*} params
* @returns
*/
export function getUserLike(params) {
return request.get('/cart/guessYouLike',params)
}
+2 -19
View File
@@ -54,13 +54,8 @@
} }
.value { .value {
width: 200rpx;
color: #9D9D9D; color: #9D9D9D;
font-size: 24rpx; font-size: 24rpx;
text-align: right;
}
.value2 {
width: auto;
} }
.red { .red {
@@ -185,10 +180,9 @@
.title { .title {
width: 160rpx; width: 160rpx;
padding: 16rpx;
border-right: 2rpx solid #D2D2D2;
color: #ADADAD; color: #ADADAD;
.title-cont {
padding: 16rpx;
}
} }
} }
@@ -197,17 +191,6 @@
} }
.value { .value {
width: calc(100% - 160rpx);
border-left: 2rpx solid #D2D2D2;
.value-cont {
padding: 16rpx;
word-wrap: break-word;
word-break: break-all;
word-break: normal;
white-space: initial;
}
}
.btn {
width: 100%; width: 100%;
padding: 16rpx; padding: 16rpx;
} }
+5 -7
View File
@@ -843,8 +843,6 @@ page {
} }
.goodWrapper .item .text { .goodWrapper .item .text {
display: flex;
flex-flow: column;
width: 5.37*100rpx; width: 5.37*100rpx;
position: relative; position: relative;
} }
@@ -868,6 +866,7 @@ page {
.goodWrapper .item .text .money { .goodWrapper .item .text .money {
font-size: 0.26*100rpx; font-size: 0.26*100rpx;
margin-top: 0.17*100rpx;
} }
.goodWrapper .item .text .evaluate { .goodWrapper .item .text .evaluate {
@@ -3255,7 +3254,6 @@ page {
.my-order .list .item .item-info .text .money { .my-order .list .item .item-info .text .money {
text-align: right; text-align: right;
color: #333;
} }
.my-order .list .item .totalPrice { .my-order .list .item .totalPrice {
@@ -3424,7 +3422,7 @@ page {
.order-details .wrapper .item .conter { .order-details .wrapper .item .conter {
color: #868686; color: #868686;
width: 4.5*100rpx; width: 5*100rpx;
text-align: right; text-align: right;
} }
@@ -3461,10 +3459,10 @@ page {
} }
.order-details .footer .bnt { .order-details .footer .bnt {
width: 1.36*100rpx; width: 1.76*100rpx;
height: 0.5*100rpx; height: 0.6*100rpx;
text-align: center; text-align: center;
line-height: 0.5*100rpx; line-height: 0.6*100rpx;
border-radius: 0.5*100rpx; border-radius: 0.5*100rpx;
color: #fff; color: #fff;
font-size: 0.27*100rpx; font-size: 0.27*100rpx;
-197
View File
@@ -1,197 +0,0 @@
/*================变量==================*/
@primary-color: #C52733;
@dark-color: #333333;
@white-color: #fff;
@colors: #C52733, #333333, #fff, #666, #F0F0F0, #999999, #E92727, #FFC543;
@classnames: primary, dark, white, secondary-dark, grey, dark1, red, yellow;
/*=====================================*/
each(@colors, {
@color: extract(@colors, @index);
@classname: extract(@classnames, @index);
.v12-@{classname} {
background-color: @color !important;
background: @color !important;
}
.v12-@{classname}-text{
color: @color !important;
}
.v12-@{classname}-border{
border: 1px solid @color !important;
}
});
/*===================字体大小======================*/
.generateFontSize(@i) when (@i <= 80) {
.v12-font-@{i} {
font-size: @i * 1rpx !important;
}
.generateFontSize(@i + 2);
}
.generateFontSize(0);
.v12-font-bold{
font-weight: bold !important;
}
.generateFontWeight(@n, @i: 100) when (@i <= @n) {
.v12-font-weight-@{i} {
font-weight: @i !important;
}
.generateFontWeight(@n, (@i + 100))
}
.generateFontWeight(900);
/*==================内外边距====================*/
.generateMarginAndPadding(@n, @i:0) when (@i<= @n) {
@baseNum: @i * 8rpx;
.v12-mt-@{i} {
margin-top: @baseNum;
}
.v12-ml-@{i} {
margin-left: @baseNum;
}
.v12-mr-@{i} {
margin-right: @baseNum;
}
.v12-mb-@{i} {
margin-bottom: @baseNum;
}
.v12-ma-@{i} {
margin-left: @baseNum;
margin-right: @baseNum;
margin-bottom: @baseNum;
margin-top: @baseNum;
}
.v12-mx-@{i} {
margin-left: @baseNum;
margin-right: @baseNum;
}
.v12-my-@{i} {
margin-bottom: @baseNum;
margin-top: @baseNum;
}
.v12-pt-@{i} {
padding-top: @baseNum;
}
.v12-pl-@{i} {
padding-left: @baseNum;
}
.v12-pr-@{i} {
padding-right: @baseNum;
}
.v12-pb-@{i} {
padding-bottom: @baseNum;
}
.v12-pa-@{i} {
padding-top: @baseNum;
padding-bottom: @baseNum;
padding-right: @baseNum;
padding-left: @baseNum;
}
.v12-px-@{i} {
padding-right: @baseNum;
padding-left: @baseNum;
}
.v12-py-@{i} {
padding-top: @baseNum;
padding-bottom: @baseNum;
}
.generateMarginAndPadding(@n, (@i + 1))
}
.generateMarginAndPadding(40);
/*==================圆角====================*/
.generateRadius(@n, @i: 0) when (@i <= @n) {
@baseRadius: @i * 1rpx;
.v12-radius-@{i} {
border-radius: @baseRadius !important;
}
.generateRadius(@n, (@i + 1))
}
.generateRadius(100);
/*=========================================*/
.generateSpacing(@n, @i: 0) when(@i <= @n) {
@baseSpacing:@i * 1rpx;
.v12-spacing-@{i} {
letter-spacing: @baseSpacing !important;
}
.generateSpacing(@n, (@i + 1))
}
.generateSpacing(100);
/*====================flex 函数表达式=====================*/
.v12-d-flex{
display: flex !important;
}
.v12-flex-column {
flex-direction: column;
}
.v12-align-center{
display: flex;
align-items: center;
}
.v12-align-start{
display: flex;
align-items: start;
}
.v12-align-end{
display: flex;
align-items: end;
}
.v12-align-baseline{
display: flex;
align-items: baseline;
}
.v12-justify-center{
display: flex;
justify-content: center;
}
.v12-justify-around{
display: flex;
justify-content: space-around;
}
.v12-justify-between{
display: flex;
justify-content: space-between;
}
.v12-justify-start{
display: flex;
justify-content: flex-start;
}
.v12-justify-end{
display: flex;
justify-content: flex-end;
}
.v12-d-grid-columns-2 {
display: grid;
grid-template-columns: 1fr 1fr;
}
.v12-text-right{
text-align: right;
}
.v12-text-left{
text-align: left;
}
.v12-text-center{
text-align: center;
}
.v12-btn{
width: 136rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
border-radius: 50rpx;
color: #fff;
font-size: 27rpx;
}
.v12-full-width{
width: 100%;
}
-1
View File
@@ -63,7 +63,6 @@ export default {
date = date.replace(/-/g, '/'); date = date.replace(/-/g, '/');
let timestamp = new Date(date).getTime(); let timestamp = new Date(date).getTime();
let now = new Date().getTime(); let now = new Date().getTime();
return timestamp - now; return timestamp - now;
}, },
+4 -9
View File
@@ -1,7 +1,6 @@
<template> <template>
<view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change"> <view class="components-checkbox-icon jc-center ai-center" :class="{'isSelected':isSelected}" @click="change">
<!-- <image class="icon-hook" :src="webUrl + '/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/> --> <image class="icon-hook" :src="$VUE_APP_RESOURCES_URL+'/20240109175325131970.png'" mode="scaleToFill" v-if="isSelected"/>
<u-icon name="checkmark-circle-fill" color="#C52733" v-if="isSelected"></u-icon>
</view> </view>
</template> </template>
@@ -20,11 +19,6 @@ export default {
} }
} }
}, },
data() {
return {
webUrl: Object.freeze(this.$VUE_APP_RESOURCES_URL)
}
},
computed: { computed: {
isSelected: function() { isSelected: function() {
return this.defaultState return this.defaultState
@@ -44,7 +38,7 @@ export default {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
box-sizing: border-box; box-sizing: border-box;
border: 2px solid #D5D7D8; border: 2rpx solid #D5D7D8;
border-radius: 50%; border-radius: 50%;
} }
@@ -54,6 +48,7 @@ export default {
} }
.isSelected { .isSelected {
border: 3px solid #C52733; border: 3px solid #FD5749;
background: #FD5749;
} }
</style> </style>
+2 -8
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="address-text-wrapper" @tap.stop="open"> <view @tap.stop="open">
<view class="uni-input one-t address-text">{{ value }}</view> <text class="uni-input">{{ value }}</text>
<uni-popup ref="popup" type="bottom" safe-area> <uni-popup ref="popup" type="bottom" safe-area>
<view class="cityselect"> <view class="cityselect">
<view class="cityselect-header"> <view class="cityselect-header">
@@ -220,12 +220,6 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.address-text-wrapper {
width: 100%;
.address-text {
width: 100%;
}
}
.cityselect { .cityselect {
width: 100%; width: 100%;
height: 75%; height: 75%;
+28 -75
View File
@@ -1,46 +1,27 @@
<template> <template>
<view class="components-coupons"> <view class="components-coupons">
<view class="image-wrap"> <image class="coupons__cover" :src="data.image" mode="widthFix"/>
<image
:src="data.image"
class="coupons__cover"
mode="widthFix"
/>
<view @click="selectCoupon" class="check-radio" :class="{'v12-primary': data.checked}">
<radio
v-if="radioModel && data.status === 0"
:value="data.id"
:checked="data.checked"
color="#C52733"
borderColor="#C52733"
/>
</view>
</view>
<view class="coupons__section flex jc-between ai-center"> <view class="coupons__section flex jc-between ai-center">
<view> <view>有效期至
<text class="v12-dark-text v12-font-weight-500 v12-font-28">有效期至</text> <text>{{ data.endTime }}</text>
<text class='v12-primary-text v12-font-weight-500 v12-font-28'>{{ data.endTime }}</text> </view>
<view class="coupons__tag coupons__tag-expire" v-if="data.status===2">已到期</view>
<view class="coupons__tag" @click="goGoods()" v-if="data.status===0 && !radioModel">去使用</view>
<view @click="selectCoupon">
<radio :value="data.id" :checked="data.checked" color="#FF564A" v-if="radioModel && data.status===0"/>
</view> </view>
<!-- status: 0-未使用1-已使用2-已过期 -->
<view
v-if="data.status === 2"
class="coupons__tag coupons__tag-expire v12-font-24"
>已到期</view>
<view
v-if="data.status === 0 && !radioModel"
class="coupons__tag coupons__tag-expire v12-font-24"
>不可用</view>
</view> </view>
<view class="coupons__rules"> <view class="coupons__rules">
<view class="coupons__rules-title v12-font-22" @click="changeRules()">使用规则 <view class="coupons__rules-title" @click="changeRules()">使用规则
<image :class="{'open':isOpen}" :src="webUrl + '/20231125220409665027.png'" mode="scaleToFill"/> <image :class="{'open':isOpen}" :src="webUrl+'/20231125220409665027.png'" mode="scaleToFill"/>
</view> </view>
<view <view
:class="isOpen ? 'auto-height' : ''" :class="isOpen ? 'auto-height' : ''"
class="coupon-html" class="coupon-html"
> >
<rich-text class='v12-font-22 v12-dark1-text' :nodes="data.description" /> <rich-text :nodes="data.description" />
</view> </view>
</view> </view>
</view> </view>
@@ -50,13 +31,7 @@
export default { export default {
name: "Coupons", name: "Coupons",
props: { props: {
data: { data: Object,
type: Object,
default: () => {
return {}
}
},
// 是否显示选择框
radioModel: { radioModel: {
type: Boolean, type: Boolean,
default: false default: false
@@ -76,61 +51,39 @@ export default {
changeRules() { changeRules() {
this.isOpen = !this.isOpen this.isOpen = !this.isOpen
}, },
goGoods() {
uni.switchTab({url: '/pages/home/landMark'})
// this.$global.navToGoods(this.data.productId)
},
selectCoupon() { selectCoupon() {
if (!this.radioModel) return if (!this.radioModel) return
// 已选中则可以取消选中 this.$emit('change', this.data.id)
this.$emit('change', this.data.checked ? '' : this.data.id)
} }
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.check-radio{
position: absolute;
bottom: 10px;
right: 16px;
height: 32rpx;
width: 32rpx;
border-radius: 50%;
border: 2px solid #C52733;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
radio {
margin-right: -6px;
}
}
.image-wrap{
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 30rpx 0;
border-radius: 20rpx;
position: relative
}
.components-coupons { .components-coupons {
width: 686rpx; width: 686rpx;
box-sizing: border-box; box-sizing: border-box;
border: 2rpx solid #FF564A;
border-radius: 16rpx; border-radius: 16rpx;
overflow: hidden; overflow: hidden;
background: #fff;
image { image {
vertical-align: middle; vertical-align: middle;
} }
.coupons__cover { .coupons__cover {
width: 600rpx; width: 100%;
height: 200rpx; height: auto;
border-radius: 20rpx;
} }
.coupons__section { .coupons__section {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 18rpx 20rpx 16rpx 50rpx; padding: 18rpx 20rpx 16rpx 16rpx;
font-size: 32rpx; font-size: 32rpx;
line-height: 1; line-height: 1;
@@ -160,7 +113,7 @@ export default {
} }
.coupons__rules { .coupons__rules {
padding: 0 20rpx 20rpx 50rpx; padding: 0 20rpx 20rpx 16rpx;
.coupons__rules-title { .coupons__rules-title {
color: #999999; color: #999999;
@@ -177,11 +130,11 @@ export default {
} }
} }
.coupon-html { .coupon-html {
height: 80rpx;
overflow: hidden; overflow: hidden;
transition: all .3s ease-in-out; transition: all .3s;
height: 60rpx;
&.auto-height { &.auto-height {
height: auto !important; height: auto;
} }
} }
} }
+38 -144
View File
@@ -1,97 +1,21 @@
<template> <template>
<view class="popup-coupons"> <view class="popup-coupons">
<view class="popup-box"> <view class="popup-box">
<view class="popup-title bold tc">优惠详情</view> <view class="popup-title bold tc">选择优惠券</view>
<SubSection <SubSection :current="current" :can-use="canUse" :not-use="notUse" radioModel @change="changeNav"/>
:current="current"
:can-use="canUse"
:not-use="notUse"
radio-model
@change="changeNav"
v-if="showTab"
/>
<view class="v12-radius-20 v12-white v12-align-center v12-justify-around v12-pa-3" v-else>
<view class="">
<view class="v12-text-center v12-font-28">
券后价
</view>
<view class="v12-mt-3 v12-text-center v12-red-text">
<text class="v12-font-28">
</text>
<text class="v12-font-44">
{{ computePrice }}
</text>
</view>
</view>
<view class="v12-text-center v12-font-44">
=
</view>
<view class="">
<view class="v12-text-center v12-font-28">
当前售价
</view>
<view class="v12-mt-3 v12-text-center">
<text class="v12-font-28">
</text>
<text class="v12-font-44">
{{ currentPrice }}
</text>
</view>
</view>
<view class="v12-text-center v12-font-44">
-
</view>
<view class="">
<view class="v12-text-center">
满减
</view>
<view class="v12-mt-3 v12-text-center v12-font-44">
{{ selectItem.couponPrice || 0 }}
</view>
</view>
</view>
<view class="list-box"> <view class="list-box">
<view class="larg-one v12-mb-3"> <view style="margin-bottom: 20rpx" v-for="(item,index) in list" :key="index">
<Coupons <Coupons :data="item" radioModel @change="selectCoupon"/>
:data="largOne"
:radio-model="current === 0"
@change="selectCoupon"
/>
</view> </view>
<view class="v12-font-32 v12-dark-text v12-spacing-2 v12-font-bold v12-mb-3">
更多可使用券 <view class="tc" v-if="list.length===0">
</view>
<view
v-for="(item, index) in list"
:key="index"
style="margin-bottom: 20rpx"
>
<Coupons
:data="item"
:radio-model="current === 0"
@change="selectCoupon"
v-if="index !== maxIndex"
/>
</view>
<view
v-if="list.length === 0"
class="tc"
>
<image class="zero-coupons" :src="webUrl+'/20231201201733142658.png'" mode="scaleToFill"/> <image class="zero-coupons" :src="webUrl+'/20231201201733142658.png'" mode="scaleToFill"/>
</view> </view>
</view> </view>
</view> </view>
<button disabled></button> <button disabled></button>
<view <view class="btn-done bold flex jc-center ai-center" :class="{'btn-disabled':current===1}" @click="setCoupon" v-if="current===0">确定
v-if="current === 0"
:class="{ 'btn-disabled': current === 1 }"
class="btn-done bold flex jc-center ai-center v12-primary"
@click="setCoupon"
>
确定
</view> </view>
</view> </view>
</template> </template>
@@ -102,43 +26,16 @@ import Coupons from '@/components/Coupons.vue'
export default { export default {
name: 'CouponsPopup', name: 'CouponsPopup',
components: { SubSection, Coupons }, components: {SubSection, Coupons},
props: { props: {
twoList: { twoList: {
type: Object, type: Object,
default: { default: {}
usable: [],
unusable: []
}
},
showTab: {
type: Boolean,
default: true
},
currentPrice: {
default: 0,
type: Number
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0,
couponId: uni.getStorageSync('couponId') || 0,
selectItem: {
couponPrice: 0
},
} }
}, },
computed: { computed: {
list() { list() {
const temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable'] let temp = this.current === 0 ? this.twoList['usable'] : this.twoList['unusable']
if (this.current === 0) {
const localCouponId = uni.getStorageSync('couponId') || 0
temp.map(item => {
item.checked = localCouponId === item.id
})
}
return this.$global.deepClone(temp) return this.$global.deepClone(temp)
}, },
canUse() { canUse() {
@@ -146,47 +43,46 @@ export default {
}, },
notUse() { notUse() {
return this.twoList['unusable'].length return this.twoList['unusable'].length
},
computePrice() {
return this.force2Decimal(this.currentPrice - this.selectItem.couponPrice) || this.currentPrice
},
maxIndex() {
const maxIndex = this.list.reduce((a, b, c) => {
return (this.list[a].couponPrice < b.couponPrice) ? c : a
}, 0)
return maxIndex
},
largOne() {
if(this.list[this.maxIndex]) {
this.selectCoupon(this.list[this.maxIndex].id)
uni.setStorageSync('couponId', this.list[this.maxIndex].id)
}
// this.$emit('max', this.list[this.maxIndex] || {})
return this.list[this.maxIndex] || {}
} }
},
watch: {
current() {
this.selectCoupon(this.couponId)
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
current: 0,
couponId: 0
}
}, },
mounted() { mounted() {
this.$emit('max', this.largOne) this.couponId = uni.getStorageSync('couponId') || 0
this.selectCoupon(this.couponId)
}, },
methods: { methods: {
force2Decimal(value) {
return this.$force2Decimal(value);
},
changeNav(index) { changeNav(index) {
this.current = index this.current = index
}, },
selectCoupon(id) { selectCoupon(id) {
this.couponId = id const isCancel = this.couponId === id
this.selectItem = this.list.find(e => e.id === id) || {} this.couponId = isCancel ? 0 : id
this.list.map(item => {
item.checked = id === item.id this.list?.forEach(item => {
if (!isCancel) {
item.checked = id === item.id
} else {
item.checked = false
}
}) })
}, },
setCoupon() { setCoupon() {
if (this.current === 1) return if (this.current === 1) return
uni.setStorageSync('couponId', this.couponId) // if (this.couponId !== 0) {
this.$emit('change', this.selectItem || {}) uni.setStorageSync('couponId', this.couponId)
// }
this.$emit('close')
} }
} }
} }
@@ -194,7 +90,6 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
.popup-coupons { .popup-coupons {
background: #F0F0F0;
.popup-box { .popup-box {
padding: 34rpx 32rpx; padding: 34rpx 32rpx;
} }
@@ -208,7 +103,6 @@ export default {
.list-box { .list-box {
max-height: 640rpx; max-height: 640rpx;
height: 640rpx;
margin-top: 32rpx; margin-top: 32rpx;
overflow-y: auto; overflow-y: auto;
} }
+39 -88
View File
@@ -1,61 +1,39 @@
<template> <template>
<view class="orderGoods"> <view class="orderGoods">
<view <view v-if="title.length>0" class="total acea-row row-middle" >
v-if="title.length > 0" <view class="acea-row row-left row-middle" style="position: relative;">
class="v12-pa-3 acea-row row-middle" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" src="http://admin-api.xdd618.com/file/pic/20210807230759738342.png" mode=""></image>
> <text class="title">{{title}}</text>
<view <!-- <text class="pink-dot"></text> -->
style="position: relative;" </view>
class="acea-row row-left row-middle" </view>
> <view v-else class="total">{{ cartInfo.length }}件商品</view>
<!-- <image
style="width: 32rpx;height: 32rpx;margin-right: 12rpx;"
src="http://admin-api.xdd618.com/file/pic/20210807230759738342.png" mode=""
/> -->
<text class="title v12-font-32">
{{ title }}
</text>
</view>
</view>
<view
v-else
class=""
>{{ cartInfo.length }}件商品</view>
<view class="goodWrapper"> <view class="goodWrapper">
<view <view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;" v-for="cart in cartInfo" :key="cart.id">
v-for="cart in cartInfo"
:key="cart.id"
class="item acea-row row-between-wrapper v12-mt-3"
style="flex-wrap: nowrap; border:none"
>
<view class="pictrue" style="margin-right: 20rpx;"> <view class="pictrue" style="margin-right: 20rpx;">
<image :src="cart.productInfo.image" class="image" /> <image :src="cart.productInfo.image" class="image" />
</view> </view>
<view class="text" style="height: 100%;justify-content: space-between;"> <view class="text">
<view class="acea-row row-between-wrapper"> <view class="acea-row row-between-wrapper">
<view class="name line1 one-t v12-font-bold">{{ cart.productInfo.storeName }}</view> <view class="name line1">{{ cart.productInfo.storeName }}</view>
<!-- <view class="num">x {{ cart.cartNum }}</view> -->
</view> </view>
<view class="acea-row row-middle row-between attr-wrap"> <!-- <view
<view class="attr line1"
v-if="cart.productInfo.attrInfo" v-if="cart.productInfo.attrInfo"
class="more-t v12-font-24 v12-secondary-dark-text" >{{ cart.productInfo.attrInfo.sku }}</view> -->
> <view class="acea-row row-middle row-between">
规格{{ cart.productInfo.attrInfo.sku }} <view
</view> class="attr"
<view style="height: 38rpx;line-height:38rpx;background-color: #FFF3F2;border-radius: 19rpx;padding: 4rpx 20rpx;"
v-if="evaluate == 3" v-if="cart.productInfo.attrInfo"
class="evaluate" >属性{{ cart.productInfo.attrInfo.sku }}</view>
@click="routerGo(cart)" <view v-if="evaluate == 3" class="evaluate" style="bottom: 0 !important;position: relative;height: 36rpx !important;width: 90rpx !important;line-height: 36rpx !important;font-size: 32rpx;border-radius: 18rpx;" @click="routerGo(cart)">评价</view>
>评价</view> </view>
</view>
<view class="money font-color-lightred acea-row row-between"> <view class="money font-color-lightred acea-row row-between">
<view class="v12-font-bold"> <text>{{ cart.truePrice }}</text>
<text class="v12-font-28 v12-dark-text">应付</text> <text class="num" style="margin-left: 10rpx;">x{{ cart.cartNum }}</text>
<text class="v12-font-22"></text> </view>
<text class="v12-primary-text v12-font-28">{{ cart.truePrice }}</text>
</view>
<text class="num v12-dark-text">x{{ cart.cartNum }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -90,48 +68,21 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.orderGoods{ .pink-dot{
border-radius: 20rpx 20rpx 0 0; width:24rpx;
} height:24rpx;
.item{ background:rgba(255,86,74,0.4);
height: 160rpx !important; border-radius:50%;
} position: absolute;
z-index: 0;
bottom: 24rpx;
right: -12rpx;
}
.title{ .title{
font-size:26rpx; font-size:26rpx;
color:#080F1A; color:#080F1A;
font-weight: bold; font-weight: bold;
} }
.goodWrapper .item .pictrue {
width: 160rpx;
height: 160rpx;
}
.goodWrapper .item .pictrue .image {
display: block;
width: 160rpx;
height: 160rpx;
border-radius: 16rpx;
}
.attr-wrap {
position: relative;
margin-top: 8rpx;
align-items: flex-start;
}
.text .attr {
max-width: calc(100% - 130rpx);
margin: 0 !important;
padding: 6rpx 20rpx;
border-radius: 20rpx;
line-height: 28rpx;
box-sizing: border-box;
background-color: #FFF3F2;
}
.evaluate {
position: relative;
top: 0;
height: 36rpx;
width: 90rpx;
border-radius: 36rpx !important;
line-height: 36rpx;
font-size: 28rpx;
}
</style> </style>
+67 -114
View File
@@ -2,56 +2,51 @@
<view> <view>
<view class="product-window" :class="attr.cartAttr === true ? 'on' : ''"> <view class="product-window" :class="attr.cartAttr === true ? 'on' : ''">
<view class="textpic acea-row row-between-wrapper"> <view class="textpic acea-row row-between-wrapper">
<view class="pictrue" @click="previewImg(attrObj.productSelect.image)"> <view class="pictrue" @click="previewImg(attr.productSelect.image)">
<image :src="attrObj.productSelect.image" class="image" /> <image :src="attr.productSelect.image" class="image" />
</view> </view>
<view class="text"> <view class="text">
<view class="money font-color-lightred v12-font-"> <view class="line1">{{ attr.productSelect.store_name }}</view>
<view class="money font-color-lightred">
<text class="num v12-font-40">{{ attrObj.productSelect.price }}</text> <text class="num">{{ attr.productSelect.price }}</text>
<text class="v12-ml-2 v12-font-weight-300 v12-font-22" style="color: #BBBBBB; text-decoration: line-through;"></text> <text class="stock">库存: {{ attr.productSelect.stock }}</text>
<text class="v12-mr-2 v12-font-weight-300 v12-font-22" style="color: #BBBBBB; text-decoration: line-through;">{{ attrObj.productSelect.otPrice }}</text>
<text class="v12-white-text v12-red v12-font-22 v12-radius-40 v12-px-1 v12-font-weight-400">会员价</text>
<!-- <text class="stock">库存: {{ attrObj.productSelect.stock }}</text> -->
</view> </view>
<view class="more-t">{{ attrObj.productSelect.store_name }}</view>
</view> </view>
<view class="iconfont icon-guanbi" @click="closeAttr"></view> <view class="iconfont icon-guanbi" @click="closeAttr"></view>
</view> </view>
<view class="productWinList"> <view class="productWinList">
<view <view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
v-for="(item, index) in attrObj.productAttr"
:key="index"
class="item"
>
<view class="title">{{ item.attrName }}</view> <view class="title">{{ item.attrName }}</view>
<view class="listn acea-row v12-justify-start"> <view class="listn acea-row row-middle">
<view <view
v-for="(subItem, subIndex) in item.attrValue" v-for="(itemn, indexn) in item.attrValue"
:key="subIndex" :key="indexn"
:class="{ :class="{
'actived': subItem.check, 'on': item.index == indexn,
'disabled': !subItem.canUsed 'disabled': productValue[itemn.attr].stock === 0
}" }"
class="itemn v12-radius-40" class="itemn"
@click="tapAttr(index, subIndex, subItem)" @click="tapAttr(indexw, indexn, itemn)"
> >
{{ subItem.attr }} {{ itemn.attr }}
<text v-if="!subItem.canUsed" class="less-tag" style="color: #fff !important;">缺货</text> <text
v-if="productValue[itemn.attr].stock === 0"
class="tag"
>缺货</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="cart v12-justify-between v12-align-center"> <view class="cart">
<view class="titlev12-dark-text f12-font-32">购买数量</view> <view class="title">数量</view>
<view class="carnum acea-row row-left"> <view class="carnum acea-row row-left">
<view style="border-radius: 40rpx 0rpx 0rpx 40rpx" class="cart-btn item reduce v12-font-36 v12-font-bold v12-white-text v12-dark1 v12-dark1-border" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view> <view class="item reduce" :class="cartNum <= 1 ? 'on' : ''" @click="CartNumDes">-</view>
<view class="item v12-font-36 v12-font-bold v12-dark-text cart-btn">{{ cartNum }}</view> <view class="item num">{{ cartNum }}</view>
<view <view
style="border-radius:0 40rpx 40rpx 0" class="item plus"
class="item plus v12-font-bold v12-white-text v12-primary v12-primary-border v12-font-36 cart-btn"
:class=" :class="
cartNum >= attrObj.productSelect.stock cartNum >= attr.productSelect.stock
? 'on' ? 'on'
: '' : ''
" "
@@ -69,113 +64,71 @@ export default {
props: { props: {
attr: { attr: {
type: Object, type: Object,
default: () => { default: () => {}
return { },
productAttr: [] productValue: {
} type: Object,
} default: () => {}
}, },
cartNum: { cartNum: {
type: Number, type: Number,
default: () => 1 default: () => 1
} }
}, },
data() { data: function() {
return { return {};
attrObj: {
productSelect: {},
productAttr: []
}
}
},
created() {
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(this.attr)))
console.log(this.attrObj)
}, },
methods: { methods: {
reRender(data) { previewImg:function(imgUrl){
this.$set(this, 'attrObj', JSON.parse(JSON.stringify(data)))
// console.log(this.attrObj.productAttr)
this.$forceUpdate()
},
previewImg(imgUrl) {
uni.previewImage({ uni.previewImage({
urls:[imgUrl] urls:[imgUrl]
}) })
}, },
closeAttr() { closeAttr: function() {
this.$emit("changeFun", { action: "changeattr", value: false }) this.$emit("changeFun", { action: "changeattr", value: false });
}, },
CartNumDes() { CartNumDes: function() {
this.$emit("changeFun", { action: "ChangeCartNum", value: false }) this.$emit("changeFun", { action: "ChangeCartNum", value: false });
}, },
CartNumAdd() { CartNumAdd: function() {
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 }) this.$emit("changeFun", { action: "ChangeCartNum", value: 1 });
}, },
tapAttr(index, subIndex, subItem) { tapAttr: function(indexw, indexn, itemn) {
// 缺货的点击了没效果 if (this.productValue[itemn.attr].stock === 0) {
if (!subItem.canUsed || subItem.check) {
return return
} }
this.attrObj.productAttr[index].attrValue.map((subItem, subIdx) => { // 修改商品规格不生效的原因:
subItem.check= false // H5端下面写法,attr更新,但是除H5外其他端不支持,
if (subIndex === subIdx) { // 尽量避免下面的骚写法,不要在子组件内更新props
subItem.check = true // 这里修改是为了能获取到被选中的属性
} this.attr.productAttr[indexw].index = indexn;
}) let that = this;
const value = this.getCheckedValue().sort().join(",") let value = that
this.$emit("changeFun", { .getCheckedValue()
.sort()
.join(",");
that.$emit("changeFun", {
action: "ChangeAttr", action: "ChangeAttr",
value: { value: {
value, value,
index, indexw,
subIndex indexn
} }
}) });
}, },
// 获取被选中属性 //获取被选中属性
getCheckedValue() { getCheckedValue: function() {
const productAttr = this.attrObj.productAttr let productAttr = this.attr.productAttr;
const value = [] let value = [];
productAttr.map(item => { for (let i = 0; i < productAttr.length; i++) {
item.attrValue.map(subItem => { for (let j = 0; j < productAttr[i].attrValueArr.length; j++) {
if (subItem.check) { if (productAttr[i].index === j) {
value.push(subItem.attr) value.push(productAttr[i].attrValueArr[j]);
} }
}) }
}) }
return value return value;
} }
} }
} };
</script> </script>
<style scope>
.itemn{
margin: 28rpx 0 0 34rpx !important;
width: auto;
}
.money{
margin-top: 0 !important
}
.actived{
border-color: #C52733 !important;
color: #fff !important;
background: #C52733
}
.cart-btn{
height:52rpx !important;
width:52rpx !important
}
.less-tag{
position: absolute;
background: #FF5562;
border-radius: 8rpx;
height: 38rpx;
line-height: 38rpx;
right: -15px;
top: -10px;
padding: 0 3px;
font-size: 24rpx;
font-weight:400
}
</style>
-54
View File
@@ -1,54 +0,0 @@
<template>
<view class="">
<u-popup :show="show" @close="close" @open="open" closeable>
<view class="v12-px-3">
<view class="v12-text-center v12-font-32 v12-py-3 v12-secondary-dark-text">
服务说明
</view>
<view class="wrap v12-dark-text">
<view class="service-title">
<text class="v12-dark-text v12-font-32">
售后服务
</text>
</view>
<view class="">
<text class="v12-font-28 v12-font-bold">
{{ info }}
</text>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: {
info: ''
},
data() {
return {
show:false
}
},
methods: {
close() {
this.show = false
this.$emit('close')
},
open() {
this.show = true
this.$emit('open')
}
}
}
</script>
<style>
.wrap{
background: rgba(197,39,51,0.1);
border-radius: 16rpx;
padding: 20rpx;
}
</style>
+6 -14
View File
@@ -38,15 +38,14 @@ export default {
<template> <template>
<view class="sub-section flex"> <view class="sub-section flex">
<view class="sub-section__item flex jc-center ai-center" <view class="sub-section__item flex jc-center ai-center" :class="{'sub-section__active':index===0}"
@click="change(0)"> @click="change(0)">
可使用 ({{ canUse }}) 可使用 ({{ canUse }})
</view> </view>
<view class="sub-section__item flex jc-center ai-center" <view class="sub-section__item flex jc-center ai-center" :class="{'sub-section__active':index===1}"
@click="change(1)"> @click="change(1)">
{{radioModel?'不可用':'已到期'}} ({{ notUse }}) {{radioModel?'不可用':'已到期'}} ({{ notUse }})
</view> </view>
<view class="sub-section__active" :style="{left: (80 + index * 360) + 'rpx'}"></view>
</view> </view>
</template> </template>
@@ -55,27 +54,20 @@ export default {
width: 686rpx; width: 686rpx;
height: 80rpx; height: 80rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 20rpx; border: 2rpx solid #FF564A;
border-radius: 4rpx;
font-size: 32rpx; font-size: 32rpx;
overflow: hidden;
position: relative;
.sub-section__item { .sub-section__item {
width: 50%; width: 50%;
background: #FFFFFF; background: #FFFFFF;
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
position: relative;
} }
.sub-section__active { .sub-section__active {
position: absolute; background: #FF564A;
width: 140rpx; color: #FFFFFF;
height: 8rpx;
background: linear-gradient(to right, #C52733 0%, rgba(211,92,101,0.91) 54%, rgba(255,255,255,0.62) 100%);
border-radius: 0rpx 0rpx 26rpx 26rpx;
bottom: (80 - 34) / 2 * 1rpx;
transition: left ease-in-out 0.3s;
} }
} }
</style> </style>
+6 -30
View File
@@ -1,9 +1,9 @@
<template> <template>
<view class="evaluateWtapper"> <view class="evaluateWtapper">
<view <view
class="evaluateItem"
v-for="(item, evaluateWtapperIndex) in reply" v-for="(item, evaluateWtapperIndex) in reply"
:key="evaluateWtapperIndex" :key="evaluateWtapperIndex"
class="evaluateItem"
> >
<view class="pic-text acea-row row-middle"> <view class="pic-text acea-row row-middle">
<view class="pictrue"> <view class="pictrue">
@@ -11,30 +11,14 @@
</view> </view>
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view class="name line1">{{ item.nickname }}</view> <view class="name line1">{{ item.nickname }}</view>
<view class="start" :class="'star' + item.star"></view>
</view> </view>
</view> </view>
<view class="v12-px-4"> <view class="time">{{ item.createTime }} {{ item.sku||'' }}</view>
<view class="v12-secondary-dark-text v12-font-24 attr-bg"> {{ item.sku }}</view> <view class="evaluate-infor">{{ item.comment }}</view>
<view class="start" :class="'star' + item.star"></view>
</view>
<!-- <view class="time">{{ item.createTime }} {{ item.sku||'' }}</view> -->
<view class="evaluate-infor v12-font-24">{{ item.comment }}</view>
<view class="imgList acea-row"> <view class="imgList acea-row">
<view v-if="item.video" class="pictrue"> <view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
<video <image :src="itemn" class="image" @click="previewImage(item.picturesArr,eq)" />
:src="item.video"
:poster="item.video + '?vframe/jpg/offset/1'"
controls
play-btn-position="center"
class="image"
/>
</view>
<view
v-for="(itemn, eq) in item.picturesArr"
:key="eq"
class="pictrue"
>
<image :src="itemn" class="image" @click="previewImage(item.picturesArr, eq)" />
</view> </view>
</view> </view>
<view class="reply" v-if="item.merchantReplyContent"> <view class="reply" v-if="item.merchantReplyContent">
@@ -70,11 +54,3 @@ export default {
} }
}; };
</script> </script>
<style lang="less" scoped>
.attr-bg{
background: rgba(197,39,51,0.1);
padding: 7rpx 5px;
width: fit-content;
border-radius: 12rpx;
}
</style>
+2 -17
View File
@@ -1,28 +1,13 @@
<template> <template>
<view class="noCommodity"> <view class="noCommodity">
<view class="noPictrue"> <view class="noPictrue">
<image <image :src="webUrl+'/20210203153900181449.png'" class="image"/>
v-if="type === 'good'"
:src=" webUrl + '/20210203153900181449.png'"
class="image"
/>
<image
v-if="type === 'hotel'"
:src=" webUrl + '/no-hotel.png'"
class="image"
/>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
name: 'NoGoodData', name: "NoGoodData",
props: {
type: {
type: String,
default: 'good'
}
},
data: function() { data: function() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL webUrl: this.$VUE_APP_RESOURCES_URL
-1
View File
@@ -75,7 +75,6 @@
current: cind, current: cind,
indicator: 'default' indicator: 'default'
}); });
this.$emit('click')
}, },
getheight() { getheight() {
let that = this; let that = this;
-175
View File
@@ -1,175 +0,0 @@
<template>
<view class="xdd-product-item" @click="viewHandle(item)">
<view class="focus-img">
<image
:src="item[imageKey]"
class="img"
/>
<image
v-if="item.isOldBrand"
:src="webUrl + '/home/old-mark.png'"
class="mark-img"
/>
<image
v-if="item.isLandmarkGoods"
:src="webUrl + '/home/mark-land.png'"
class="mark-img"
/>
<image
v-if="item.isCountyFamous"
:src="webUrl + '/home/qixian-mark.png'"
class="mark-img"
/>
</view>
<view class="info-wrap">
<view class="name more-t">
{{ item[nameKey] }}
</view>
<view v-if="item.bestContent" class="desc more-t">
{{ item.bestContent }}
</view>
<view v-if="item.couponName && showCoupon" class="coupon">
<view class="tag"></view>
<view class="tag">{{ item.couponName }}</view>
</view>
<view class="price-wrap">
<view class="price">
<text class="price-txt price-red">{{ item[priceKey] }}</text>
</view>
<view class="btn">
<image
:src="webUrl + '/home/icon-cart.png'"
class="img"
/>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'XddProductItem',
props: {
item: {
type: Object,
default: () => {
return {}
}
},
imageKey: {
type: String,
default: 'image'
},
nameKey: {
type: String,
default: 'storeName'
},
priceKey: {
type: String,
default: 'price'
},
// 是否显示优惠券
showCoupon: {
type: Boolean,
default: true
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
}
},
methods: {
viewHandle(item) {
this.$emit('view', item)
}
}
}
</script>
<style lang="less">
.xdd-product-item {
border-radius: 20rpx;
background-color: #fff;
overflow: hidden;
.focus-img {
position: relative;
.img {
position: relative;
z-index: 2;
display: block;
width: 345rpx;
height: 345rpx;
border-radius: 20rpx;
}
.mark-img {
position: absolute;
top: 0;
right: 0;
z-index: 3;
display: block;
width: 84rpx;
height: 74rpx;
}
}
.info-wrap {
padding: 12rpx;
.name {
font-size: 28rpx;
line-height: 40rpx;
color: #333;
}
.desc {
width: 320rpx;
padding: 10rpx 0 0 0;
color: #FFC543;
font-size: 24rpx;
}
.coupon {
display: flex;
padding: 10rpx 0 0 0;
.tag + .tag {
margin: 0 0 0 -1rpx;
}
.tag {
height: 32rpx;
padding: 0 6rpx;
border-radius: 8rpx;
border: 1rpx solid #C52733;
color: #C52733;
line-height: 32rpx;
font-size: 10px;
}
}
.price-wrap {
display: flex;
justify-content: space-between;
align-items: flex-end;
padding: 10rpx 0 0 0;
.price {
font-size: 24rpx;
line-height: 40rpx;
.price-txt {
font-size: 40rpx;
font-weight: bold;
}
}
.price-red {
margin: 0 10rpx 0 0;
color: #C52733;
}
.price-grey {
color: #C4C4C4;
}
.btn {
.img {
display: block;
width: 48rpx;
height: 48rpx;
}
}
}
}
}
</style>
-196
View File
@@ -1,196 +0,0 @@
<template>
<view
:style="{
'background-image': 'url(' + webUrl + '/home/tabbar-bg.png);'
}"
class="xdd-tabbar-wrap"
>
<view class="center-img" @click="switchTabFn('/pages/cloud/haveFun')">
<image
:src="webUrl + '/home/tabbar-center.png'"
class="img"
/>
<view
:class="currIndex === 4 ? 'curr' : ''"
class="name"
>寻趣味</view>
</view>
<view class="tabbar-list">
<view
v-for="(tabbarItem, tabbarIndex) in tabbar"
:key="tabbarIndex"
class="tabbar-item"
>
<view
v-for="(item, index) in tabbarItem"
:key="index"
:class="currIndex === item.index ? 'curr' : ''"
class="item"
@click="gotoPage(item.url, item.type, item.index)"
>
<view class="img-wrap">
<!-- 预加载两张图片可以在点击切换的时候不闪屏 -->
<image
:src="item.onIcon"
class="img on"
/>
<image
:src="item.offIcon"
class="img off"
/>
</view>
<view class="name">{{ item.name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'XddTabbar',
props: {
currIndex: {
type: Number,
default: 0
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
tabbar: [[
{
name: '首页',
onIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-01-on.png',
offIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-01-off.png',
url: '/pages/home/index',
type: 1,
index: 0
},
{
name: '消息',
onIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-02-on.png',
offIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-02-off.png',
url: '/pkg_common/views/roomLogs',
type: 2,
index: 1
}
],[
{
name: '购物车',
onIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-03-on.png',
offIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-03-off.png',
url: '/pages/cart',
type: 1,
index: 2
},
{
name: '我的',
onIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-04-on.png',
offIcon: this.$VUE_APP_RESOURCES_URL + '/home/tabbar-04-off.png',
url: '/pages/user/User/index',
type: 1,
index: 3
}
]]
}
},
methods: {
/**
* 跳转至目标页面
* type: 1-tabbar页面,2-非tabbar页面
*/
gotoPage(url, type = 1, index) {
if (this.currIndex === index) return
if (type === 1) {
this.switchTabFn(url)
}
if (type === 2) {
uni.navigateTo({ url })
}
},
switchTabFn(url) {
uni.switchTab({ url })
}
}
}
</script>
<style scoped lang="less">
.xdd-tabbar-wrap {
position: fixed;
bottom: 21rpx;
left: 21rpx;
right: 21rpx;
z-index: 99;
height: 164rpx;
background-size: 708rpx 164rpx;
background-repeat: no-repeat;
.center-img {
position: absolute;
top: -16rpx;
left: 50%;
z-index: 5;
transform: translateX(-50%);
.img {
width: 136rpx;
height: 136rpx;
}
.name {
text-align: center;
font-size: 24rpx;
color: #9a9a9a;
transform: translateY(-4rpx);
&.curr {
color: #C52733;
}
}
}
.tabbar-list {
position: relative;
z-index: 2;
display: flex;
justify-content: space-between;
padding: 70rpx 0 0 0;
.tabbar-item {
display: flex;
align-items: center;
width: calc(50% - 78rpx);
.img-wrap {
.img {
display: block;
width: 44rpx;
height: 44rpx;
margin: 0 auto;
&.on {
display: none;
}
&.off {
display: block;
}
}
}
.name {
padding: 10rpx 0 0 0;
text-align: center;
font-size: 24rpx;
color: #9a9a9a;
}
.item {
width: 140rpx;
&.curr {
.name {
color: #C52733;
}
.on {
display: block;
}
.off {
display: none;
}
}
}
}
}
}
</style>
@@ -100,7 +100,7 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
input { input {
display: none; display: none;
} }
+10 -4
View File
@@ -1,3 +1,11 @@
// export const VUE_APP_API_URL = "https://shop.xdd618.com/api";
// export const VUE_APP_API_URL = "https://www.xdd618.com/api";
// export const SERVICE_API_URL = "https://service-test.xdd618.com/api";
// export const SERVICE_API_URL = "https://service.xdd618.com/api";
// export const SOCKET_URL = "wss://service-test.xdd618.com/ws";
// export const SOCKET_URL = "wss://service.xdd618.com/ws";
const NODE_ENV = process.env.VUE_APP_ENV || 'development' const NODE_ENV = process.env.VUE_APP_ENV || 'development'
let BASE_URL = '' let BASE_URL = ''
let SERVICE_URL = '' let SERVICE_URL = ''
@@ -8,7 +16,7 @@ if (NODE_ENV === 'development' || NODE_ENV === 'test') {
SERVICE_WS_URL = 'wss://service-test.xdd618.com/ws' SERVICE_WS_URL = 'wss://service-test.xdd618.com/ws'
} }
if (NODE_ENV === 'prod') { if (NODE_ENV === 'prod') {
BASE_URL = 'https://wxapp.xdd618.com/api' BASE_URL = 'https://www.xdd618.com/api'
SERVICE_URL = 'https://service.xdd618.com/api' SERVICE_URL = 'https://service.xdd618.com/api'
SERVICE_WS_URL = 'wss://service.xdd618.com/ws' SERVICE_WS_URL = 'wss://service.xdd618.com/ws'
} }
@@ -18,9 +26,7 @@ export const SERVICE_API_URL = SERVICE_URL
export const SOCKET_URL = SERVICE_WS_URL export const SOCKET_URL = SERVICE_WS_URL
export const VUE_APP_RESOURCES_URL = "https://wxapp.xdd618.com/api/file/pic" export const VUE_APP_RESOURCES_URL = "https://www.xdd618.com/api/file/pic";
export const STATIC_RESOURCE_URL = "https://resource.xdd618.com/image" export const STATIC_RESOURCE_URL = "https://resource.xdd618.com/image"
export const WX_LIVE_APPID = "wx2b03c6e691cd7370"; export const WX_LIVE_APPID = "wx2b03c6e691cd7370";
export const pageViewDataCacheKey = 'pageViewDataCacheKey'
-5
View File
@@ -1,5 +0,0 @@
import { getPageViewDataToLocalCache } from '@/utils/util'
export const pageToWatchData = Object.assign({
'appIndex': []
}, getPageViewDataToLocalCache())
+17 -22
View File
@@ -49,30 +49,25 @@ export function takeOrderHandle(orderId) {
export function delOrderHandle(orderId) { export function delOrderHandle(orderId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showModal({ dialog.confirm({
title: '提示', mes: "确认删除该订单?",
content: '确认删除该订单?', opts() {
success(res) { delOrder(orderId)
if (res.confirm) { .then(res => {
delOrder(orderId).then(res => {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功', icon: 'success', duration: 2000
icon: 'success', });
duration: 2000 resolve(res);
})
resolve(res)
}).catch(err => {
uni.showToast({
title: '删除失败',
icon: 'none',
duration: 2000
})
reject(err)
}) })
} .catch(err => {
} uni.showToast({
}) title: '删除失败', icon: 'none', duration: 2000
}) });
reject(err);
});
}
});
});
} }
export function payOrderHandle(orderId, type, from) { export function payOrderHandle(orderId, type, from) {
+19 -25
View File
@@ -15,11 +15,8 @@ import {
WX_LIVE_APPID WX_LIVE_APPID
} from "@/config"; } from "@/config";
import uView from "uview-ui"; import uView from "uview-ui";
import GooSkeleton from '@/components/GooSkeleton/index.vue'
import { pageToWatchData } from '@/config/page'
Vue.use(uView) Vue.use(uView);
Vue.component('GooSkeleton', GooSkeleton)
Vue.mixin(mixin) Vue.mixin(mixin)
// 注册全局组件 // 注册全局组件
@@ -33,8 +30,7 @@ Vue.prototype.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL
Vue.prototype.$STATIC_RESOURCE_URL = STATIC_RESOURCE_URL Vue.prototype.$STATIC_RESOURCE_URL = STATIC_RESOURCE_URL
Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
Vue.prototype.$WX_LIVE_APPID = WX_LIVE_APPID Vue.prototype.$WX_LIVE_APPID = WX_LIVE_APPID
Vue.prototype.$global = global Vue.prototype.$global = global;
Vue.prototype.$pageToWatchData = pageToWatchData
Vue.prototype.$validator = function (rule) { Vue.prototype.$validator = function (rule) {
return new schema(rule); return new schema(rule);
@@ -46,33 +42,31 @@ Vue.prototype.$validator = function (rule) {
// cookie.clearAll(); // cookie.clearAll();
// cookie.set(CACHE_KEY, 1); // cookie.set(CACHE_KEY, 1);
// } // }
// 强制转为几位小数,不足的补0 //强制转为几位小数,不足的补0
const forceToDecimal = function changeToDecimal(value, len = 1) { var forceToDecimal = function changeToDecimal(x, len, ignore = false) {
const f_x = parseFloat(value) var f_x = parseFloat(x);
if (isNaN(f_x)) { if (isNaN(f_x)) {
return 0 return 0;
} }
let s = f_x.toString() var f = Math.round(f_x * 100) / 100;
let rs = s.indexOf('.') if (ignore) {
f = Math.floor(f_x * 100) / 100;
}
var s = f.toString();
var rs = s.indexOf('.');
if (rs < 0) { if (rs < 0) {
rs = s.length rs = s.length;
s += '.' s += '.';
} }
while (s.length <= rs + len) { while (s.length <= rs + len) {
s += '0' s += '0';
} }
const tempArr = s.split('.') return s;
const decimalArr = tempArr[1].split('')
let res = tempArr[0] + '.'
for (let i = 0; i < len; i++) {
res += decimalArr[i]
}
return res
} }
// 强制转为2位小数,不足的补0 //强制转为2位小数,不足的补0
const force2Decimal = function change2Decimal(value) { var force2Decimal = function change2Decimal(x, ignore = false) {
return forceToDecimal(value, 2) return forceToDecimal(x, 2, false);
} }
Vue.prototype.$force2Decimal = force2Decimal Vue.prototype.$force2Decimal = force2Decimal
-36
View File
@@ -1,36 +0,0 @@
import {
pageToWatchShowCount,
pageToWatchShowTimer,
getCurrDateTime,
TimeDifference
} from '@/utils/util'
export const pageListenMixins = {
data(){
return {
pageViewDateTime: ''
}
},
onShow() {
this.pageViewDateTime = getCurrDateTime()
this.pageToWatchShowCount(this.pageKeyId)
},
onUnload() {
this.pageToHideHandle()
},
methods: {
pageToWatchShowCount,
pageToWatchShowTimer,
pageToHideHandle() {
const visitTime = TimeDifference(this.pageViewDateTime, getCurrDateTime())
if (visitTime > 0) {
this.pageToWatchShowTimer(this.pageKeyId, {
statsName: this.pageKeyId,
statsTime: this.pageViewDateTime,
visitTime
})
}
this.pageViewDateTime = ''
console.log('清除页面监听-----%s', this.pageKeyId)
}
}
}
+107 -70
View File
@@ -58,7 +58,7 @@
{ {
"path": "pages/shop/GoodSearch/index", "path": "pages/shop/GoodSearch/index",
"style": { "style": {
"navigationBarTitleText": "搜索" "navigationBarTitleText": "搜索商品"
} }
}, },
{ {
@@ -78,7 +78,7 @@
{ {
"path": "pages/shop/GoodsList/index", "path": "pages/shop/GoodsList/index",
"style": { "style": {
"navigationBarTitleText": "搜索" "navigationBarTitleText": "商品列表"
} }
}, },
{ {
@@ -139,13 +139,6 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{
"path": "pages/shop/GoodsCon/qualifications",
"style": {
"navigationBarTitleText": "商家资质",
"navigationBarTextStyle": "black"
}
},
{ {
"path": "pages/user/address/AddAddress/index", "path": "pages/user/address/AddAddress/index",
"style": { "style": {
@@ -208,14 +201,6 @@
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF"
} }
}, },
{
"path": "pages/user/History/index",
"style": {
"navigationBarTitleText": "商品足迹",
"navigationBarBackgroundColor": "#FFFFFF",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/user/UserBill/index", "path": "pages/user/UserBill/index",
"style": { "style": {
@@ -302,6 +287,96 @@
"navigationBarTitleText": "退货列表" "navigationBarTitleText": "退货列表"
} }
}, },
{
"path": "pages/orderAdmin/OrderIndex/index",
"style": {
"navigationBarTitleText": "商家订单统计"
}
},
{
"path": "pages/orderAdmin/AdminOrderList/index",
"style": {
"navigationBarTitleText": "订单"
}
},
{
"path": "pages/orderAdmin/GoodsDeliver/index",
"style": {
"navigationBarTitleText": "发货"
}
},
{
"path": "pages/orderAdmin/AdminOrder/index",
"style": {
"navigationBarTitleText": "商家订单列表"
}
},
{
"path": "pages/orderAdmin/Statistics/index",
"style": {
"navigationBarTitleText": "商家统计数据"
}
},
{
"path": "pages/orderAdmin/OrderCancellation/index",
"style": {
"navigationBarTitleText": "商家取消订单"
}
},
{
"path": "pages/activity/Poster/index",
"style": {
"navigationBarTitleText": "推广海报"
}
},
{
"path": "pages/activity/DargainDetails/index",
"style": {
"navigationBarTitleText": "帮砍价"
}
},
{
"path": "pages/activity/GoodsBargain/index",
"style": {
"navigationBarTitleText": "砍价列表"
}
},
{
"path": "pages/activity/BargainRecord/index",
"style": {
"navigationBarTitleText": "砍价记录"
}
},
{
"path": "pages/activity/GoodsGroup/index",
"style": {
"navigationBarTitleText": "团购商品列表"
}
},
{
"path": "pages/activity/GroupDetails/index",
"style": {
"navigationBarTitleText": "团购商品详情"
}
},
{
"path": "pages/activity/GroupRule/index",
"style": {
"navigationBarTitleText": "团购规则"
}
},
{
"path": "pages/activity/GoodsSeckill/index",
"style": {
"navigationBarTitleText": "秒杀"
}
},
{
"path": "pages/activity/SeckillDetails/index",
"style": {
"navigationBarTitleText": "秒杀详情"
}
},
{ {
"path": "pages/map/index", "path": "pages/map/index",
"style": { "style": {
@@ -373,12 +448,6 @@
"style": { "style": {
"navigationBarTitleText": "我的喜欢" "navigationBarTitleText": "我的喜欢"
} }
},
{
"path": "pages/user/Points/index",
"style": {
"navigationBarTitleText": "积分"
}
} }
], ],
"subPackages": [ "subPackages": [
@@ -561,12 +630,6 @@
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{
"path": "views/heritageGoodAndVideo",
"style": {
"navigationBarTitleText": ""
}
},
{ {
"path": "views/homestay", "path": "views/homestay",
"style": { "style": {
@@ -589,40 +652,7 @@
{ {
"path": "views/famousList", "path": "views/famousList",
"style": { "style": {
"navigationBarTitleText": "寻迹千县" "navigationBarTitleText": "千县名品"
}
},
{
"path": "views/famousQianxian",
"style": {
"navigationBarTitleText": "寻迹千县"
}
},
{
"path": "views/famousQianxianShop",
"style": {
"navigationBarTitleText": "寻迹千县",
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianTheme",
"style": {
"navigationBarTitleText": "寻迹千县",
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianVillageShop",
"style": {
"navigationBarTitleText": "寻迹千县",
"navigationStyle": "custom"
}
},
{
"path": "views/famousQianxianInvestment",
"style": {
"navigationBarTitleText": "招商政策"
} }
}, },
{ {
@@ -826,6 +856,14 @@
"navigationBarTitleText": "文玩" "navigationBarTitleText": "文玩"
} }
}, },
{
"path": "views/store",
"style": {
"navigationBarTitleText": "文玩店铺详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "views/storeList", "path": "views/storeList",
"style": { "style": {
@@ -845,13 +883,12 @@
}, },
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "地标文化特产", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"tabBar": { "tabBar": {
"color": "#8B8F99", "color": "#8B8F99",
"custom": true,
"selectedColor": "#FF564A", "selectedColor": "#FF564A",
"borderStyle": "black", "borderStyle": "black",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
@@ -863,10 +900,10 @@
"text": "首页" "text": "首页"
}, },
{ {
"pagePath": "pages/cloud/haveFun", "pagePath": "pages/home/landMark",
"iconPath": "static/tabbar/icon-land.png", "iconPath": "static/tabbar/icon-land.png",
"selectedIconPath": "static/tabbar/icon-land-hot.png", "selectedIconPath": "static/tabbar/icon-land-hot.png",
"text": "寻趣味" "text": "地标好物"
}, },
{ {
"pagePath": "pages/cart", "pagePath": "pages/cart",
@@ -888,7 +925,7 @@
{ {
"name": "商品详情", "name": "商品详情",
"path": "pages/shop/GoodsCon/index", "path": "pages/shop/GoodsCon/index",
"query": "id=588" "query": "id=277"
}, },
{ {
"name": "店铺详情", "name": "店铺详情",
@@ -926,8 +963,8 @@
"query": "" "query": ""
}, },
{ {
"name": "搜索", "name": "特色礼品",
"path": "pages/shop/GoodsList/index", "path": "pkg_product/views/giftList",
"query": "" "query": ""
} }
] ]
@@ -130,7 +130,7 @@ export default {
// this.videoContext = uni.createVideoContext('myVideo'); // this.videoContext = uni.createVideoContext('myVideo');
// this.videoContext.requestFullScreen(); // this.videoContext.requestFullScreen();
this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video + '&id=' + video.id); this.$yrouter.push('/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl='+video.video);
}, },
liveClick:function(video){ liveClick:function(video){
var liveAppId = this.$WX_LIVE_APPID; var liveAppId = this.$WX_LIVE_APPID;
@@ -4,18 +4,16 @@
</view> </view>
</template> </template>
<script> <script>
import uniPopup from '@/components/uni-popup/uni-popup.vue' import uniPopup from '@/components/uni-popup/uni-popup.vue';
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components:{ components:{
uniPopup uniPopup
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
curPlayVideoUrl:'', curPlayVideoUrl:'',
isVideoPopupShow:false, isVideoPopupShow:false
pageKeyId: ''
} }
}, },
onReady: function(res) { onReady: function(res) {
@@ -23,9 +21,10 @@ export default {
this.videoContext.requestFullScreen(); this.videoContext.requestFullScreen();
}, },
onLoad:function(e){ onLoad:function(e){
this.curPlayVideoUrl = e.videoUrl
const id = options.id this.curPlayVideoUrl = e.videoUrl;
this.pageKeyId = `findVideo_videoId_${id}` //this.$refs.popup.open();
}, },
methods: { methods: {
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
+29 -27
View File
@@ -32,69 +32,71 @@
</template> </template>
<script> <script>
import {getStoreVideoType, getArticleList} from '@/api/public' import {getStoreVideoType, getArticleList} from "@/api/public";
import {getVideoList} from '@/api/user' import {getVideoList} from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
typeList: [{'label': '全部', 'value': ''}], typeList: [{"label": "全部", "value": ""}],
type: '', type: "",
page: 1, page: 1,
limit: 10, limit: 10,
keyword: '', keyword: "",
list: [], list: [],
isWait: false, isWait: false
pageKeyId: Object.freeze('findVideoList')
} }
}, },
onLoad() { onLoad() {
this.getType() this.getType();
this.fetchList() this.fetchList();
}, },
onReachBottom() { onReachBottom() {
this.page++ this.page++;
this.fetchList() this.fetchList();
}, },
methods: { methods: {
getType() { getType() {
getStoreVideoType().then(({data}) => { getStoreVideoType().then(({data}) => {
if (data.length > 0) { if (data.length > 0) {
data.forEach(item => { data.forEach(item => {
this.typeList.push(item) this.typeList.push(item);
}) })
} }
}) });
}, },
changeType(item) { changeType(item) {
this.type = item.value this.type = item.value;
this.page = 1 this.page = 1;
this.list = [] this.list = [];
this.fetchList() this.fetchList();
}, },
fetchList() { fetchList() {
if (this.isWait) return if (this.isWait) return;
this.isWait = true this.isWait = true;
const params = {
let params = {
type: this.type, type: this.type,
page: this.page, page: this.page,
limit: this.limit limit: this.limit
} };
getVideoList(params).then(res => { getVideoList(params).then(res => {
if (res.status === 200) { if (res.status === 200) {
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
res.data[i].hide = true res.data[i].hide = true;
this.list.push(res.data[i]) this.list.push(res.data[i])
} }
} }
this.isWait = false this.isWait = false;
}) });
}, },
goDetail(item) { goDetail(item) {
this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video + '&id=' + item.id) this.$yrouter.push("/pages/VideoPlayBackList/VideoPlayBackDetail?videoUrl=" + item.video);
} }
} }
} }
+131
View File
@@ -0,0 +1,131 @@
<template>
<view class="bargain-record" ref="container">
<view class="item" v-for="(item, bargainrecordIndex) in bargain" :key="bargainrecordIndex">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-around">
<view class="line1">{{ item.title }}</view>
<count-down
:isDay="true"
:tipText="'倒计时 '"
:dayText="' 天 '"
:hourText="' 时 '"
:minuteText="' 分 '"
:secondText="' 秒'"
:datatime="item.datatime"
></count-down>
<view class="money font-color-red">
已砍至
<text class="symbol"></text>
<text class="num">{{ item.residuePrice }}</text>
</view>
</view>
</view>
<view class="bottom acea-row row-between-wrapper">
<view class="purple" v-if="item.status === 1">活动进行中</view>
<view class="success" v-else-if="item.status === 3">砍价成功</view>
<view class="end" v-else>活动已结束</view>
<view class="acea-row row-middle row-right">
<view
class="bnt cancel"
v-if="item.status === 1"
@click="getBargainUserCancel(item.bargainId)"
>取消活动</view>
<view
class="bnt bg-color-red"
v-if="item.status === 1"
@click="goDetail(item.bargainId)"
>继续砍价</view>
<view class="bnt bg-color-red" v-else @click="goList">重开一个</view>
</view>
</view>
</view>
<Loading :loaded="status" :loading="loadingList"></Loading>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import { getBargainUserList, getBargainUserCancel } from "@/api/activity";
import Loading from "@/components/Loading";
export default {
name: "BargainRecord",
components: {
CountDown,
Loading
},
props: {},
data: function() {
return {
bargain: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20 //数量
};
},
mounted: function() {
this.getBargainUserList();
},
onReachBottom() {
!this.loadingList && this.getBargainUserList();
},
methods: {
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: { id, partake: 0 }
});
},
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index"
});
},
getBargainUserList: function() {
var that = this;
if (that.loadingList) return;
if (that.status) return;
getBargainUserList({ page: that.page, limit: that.limit })
.then(res => {
that.status = res.data.length < that.limit;
that.bargain.push.apply(that.bargain, res.data);
that.page++;
that.loadingList = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
getBargainUserCancel: function(bargainId) {
var that = this;
getBargainUserCancel({ bargainId: bargainId })
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
that.status = false;
that.loadingList = false;
that.page = 1;
that.bargain = [];
that.getBargainUserList();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
+617
View File
@@ -0,0 +1,617 @@
<template>
<view class="bargain">
<!-- 在header上加 on 为请求支援 -->
<view :class="[bargainPartake != userInfo.uid ? 'header on' : 'header']">
<view class="people">{{ lookCount }}人查看 {{ shareCount }}人分享 {{ userCount }}人参与</view>
<!-- 帮助砍价帮砍成功-->
<view class="pictxt acea-row row-center-wrapper" v-if="bargainPartake != userInfo.uid">
<view class="pictrue">
<image :src="bargainUserInfo.avatar" />
</view>
<view class="text">
{{ bargainUserInfo.nickname }}
<text>邀请您帮忙砍价</text>
</view>
</view>
<count-down
:isDay="true"
:tipText="'倒计时 '"
:dayText="' 天 '"
:hourText="' 时 '"
:minuteText="' 分 '"
:secondText="' 秒'"
:datatime="datatime"
></count-down>
</view>
<view class="wrapper">
<view class="pictxt acea-row row-between-wrapper" @click="openAlone">
<view class="pictrue">
<image :src="bargain.image" />
<view class="bargain_view">
查看商品
<view class="iconfont icon-jiantou iconfonts"></view>
</view>
</view>
<view class="text acea-row row-column-around">
<view class="line2" v-text="bargain.title"></view>
<view class="money font-color-red">
已砍至:
<text class="num" v-text="price"></text>
</view>
<view class="acea-row row-middle">
<view class="successNum" v-text="'原价' + bargain.price"></view>
<view class="successNum" v-text="'已有' + bargainSumCount + '人砍价成功'"></view>
</view>
</view>
</view>
<view class="cu-progress acea-row row-middle round margin-top">
<view
class="acea-row row-middle bg-red"
:style="{ width: loading ? pricePercent + '%' : '' }"
></view>
</view>
<view class="balance acea-row row-between-wrapper">
<view v-text="'已砍' + alreadyPrice + '元'"></view>
<view v-if="surplusPrice === 0">砍价成功</view>
<view v-else v-text="'还剩' + surplusPrice + '元'"></view>
</view>
<!-- 帮助砍价帮砍成功-->
<view
class="bargainSuccess"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>
<span class="iconfont icon-xiaolian"></span>已成功帮助好友砍价
</view>
<!-- 砍价成功-->
<view
class="bargainSuccess"
v-if="
surplusPrice === 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1 &&
!helpListLoading
"
>
<span class="iconfont icon-xiaolian"></span>恭喜您砍价成功,快去支付吧~
</view>
<view
v-if="userBargainStatus == 0 && bargainPartake === userInfo.uid"
class="bargainBnt"
@click="goParticipate"
>立即参与砍价</view>
<view
class="bargainBnt"
@click="goPoster"
v-if="
surplusPrice > 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1 &&
!helpListLoading
"
>邀请好友帮砍价</view>
<view
class="bargainBnt"
@click="getBargainHelp"
v-else-if="
bargainPartake != userInfo.uid &&
userBargainStatus == 1 &&
statusUser &&
!helpListLoading
"
>帮好友砍一刀</view>
<view
class="bargainBnt"
@click="getBargainStart"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>我也要参与</view>
<view
class="bargainBnt"
@click="goPay"
v-if="
surplusPrice === 0 &&
bargainPartake === userInfo.uid &&
userBargainStatus === 1
"
>立即支付</view>
<view class="bargainBnt on" @click="goList">抢更多商品</view>
<view class="tip">
已有
<span class="font-color-red" v-text="helpCount"></span>
位好友成功帮您砍价
</view>
<view class="lock"></view>
</view>
<view class="bargainGang">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">砍价帮</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="list">
<view
class="item acea-row row-between-wrapper"
v-for="(item, bargainHelpListIndex) in bargainHelpList"
:key="bargainHelpListIndex"
>
<view class="pictxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.avatar" />
</view>
<view class="text">
<view class="name line1" v-text="item.nickname"></view>
<view class="line1" v-text="item.add_time"></view>
</view>
</view>
<view class="money font-color-red">
<text class="iconfont icon-kanjia"></text>
砍掉{{ item.price }}元
</view>
</view>
</view>
<view
class="load font-color-red"
v-if="!helpListStatus && !helpListLoading"
@click="getBargainHelpList"
>点击加载更多</view>
<view class="lock"></view>
</view>
<view class="goodsDetails">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">商品详情</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="conter" v-html="bargain.description"></view>
<view class="lock"></view>
</view>
<view class="goodsDetails">
<view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
<view class="titleCon">活动规则</view>
<view class="pictrue on">
<image :src="webUrl+'/20230304134450627525.png'" />
</view>
</view>
<view class="conter" v-html="bargain.rule"></view>
</view>
<view class="bargainTip" :class="active === true ? 'on' : ''">
<!-- <view class="pictrue">
<image src="@/static/images/bargainBg.jpg" />
<view class="iconfont icon-guanbi" @click="close"></view>
</view>-->
<view class="cutOff" v-if="bargainPartake === userInfo.uid">
您已砍掉
<text class="font-color-red" v-text="bargainHelpPrice"></text>元,听说分享次数越多砍价成功的机会越大哦!
</view>
<view class="cutOff on" v-else>
<view class="help font-color-red" v-text="'成功帮砍' + bargainHelpPrice + '元'"></view>,您也可以砍价低价拿哦,快去挑选心仪的商品吧~
</view>
<view class="tipBnt" @click="goPoster" v-if="bargainPartake === userInfo.uid">邀请好友帮砍价</view>
<view class="tipBnt" @click="getBargainStart" v-else>我也要参与</view>
</view>
<view class="mask" @touchmove.prevent :hidden="active === false" @click="close"></view>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import {
getBargainDetail,
getBargainShare,
getBargainStart,
getBargainHelp,
getBargainHelpPrice,
getBargainHelpList,
getBargainHelpCount,
getBargainStartUser
} from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { mapGetters } from "vuex";
import {} from "@/libs/wechat";
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
const NAME = "DargainDetails";
export default {
name: "DargainDetails",
components: {
CountDown
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
price: 0,
bargainId: 0, //砍价编号
bargainPartake: 0, //参与砍价
bargain: [], //砍价产品信息
partake: null,
bargainSumCount: 0, //砍价成功人数
activeMsg: "",
active: false,
loading: false,
datatime: 0,
lookCount: 0, //查看人数
shareCount: 0, //分享人数
userCount: 0, //参与人数
bargainHelpPrice: 0, //砍掉金额
bargainHelpList: [],
helpListStatus: false, //砍价列表是否获取完成 false 未完成 true 完成
helpListLoading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 2, //数量
helpCount: 0, //砍价帮总人数
surplusPrice: 0, //剩余金额
alreadyPrice: 0, //已砍掉价格
pricePercent: 0, //砍价进度条
bargainUserInfo: [], //砍价 开启砍价用户信息
userBargainStatus: 2, //砍价状态
statusUser: false ,// 是否帮别人砍,没砍是true,砍了false
share:{
title:'',
path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`,
imageUrl:'',
desc:'',
content:''
}
};
},
computed: mapGetters(["userInfo", "isLogin"]),
// watch: {
// $yroute: function(n) {
// var that = this;
// if (n.name === NAME) {
// that.mountedStart();
// }
// }
// },
mounted: function() {
var that = this;
that.mountedStart();
setTimeout(function() {
that.loading = true;
}, 500);
},
methods: {
//参与砍价
goParticipate() {
if (this.bargainPartake === this.userInfo.uid) this.getBargainStart();
else this.getBargainStartUser();
this.getBargainHelpCount();
},
openAlone: function() {
this.$yrouter.push({ path: "/detail/" + this.bargain.productId });
},
mountedStart: function() {
var that = this;
let url = handleQrCode();
if (url) {
that.bargainId = url.bargainId;
that.partake = url.uid;
} else {
that.bargainId = that.$yroute.query.id;
that.partake = parseInt(that.$yroute.query.partake);
}
if (
this.partake === undefined ||
this.partake <= 0 ||
isNaN(this.partake)
) {
that.bargainPartake = that.userInfo.uid;
// that.$yrouter.push({
// path: "/pages/activity/DargainDetails/index",
// query: { id: that.bargainId, partake: that.bargainPartake }
// });
} else {
that.bargainPartake = parseInt(this.partake);
}
that.getBargainHelpCountStart();
that.getBargainDetail();
that.getBargainShare(0);
// if (that.bargainPartake !== that.userInfo.uid) that.getBargainStartUser();
if (that.bargainPartake === that.userInfo.uid) {
// that.getBargainStart();
} else {
that.getBargainStartUser();
}
},
goPay: function() {
var data = {};
var that = this;
data.productId = that.bargain.productId;
data.cartNum = that.bargain.num;
data.uniqueId = "";
data.bargainId = that.bargainId;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
goPoster: function() {
var that = this;
that.getBargainShare(that.bargainId);
this.$yrouter.push({
path: "/pages/activity/Poster/index",
query: { id: that.bargainId, type: 2 }
});
},
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index"
});
},
//砍价分享
//bargainId 0 获取 查看人数 分享人数 参与人数
//bargainId 砍价产品编号 添加分享次数 获取 查看人数 分享人数 参与人数
getBargainShare: function(bargainId) {
var that = this;
getBargainShare({ bargainId: bargainId }).then(res => {
that.lookCount = res.data.lookCount;
that.shareCount = res.data.shareCount;
that.userCount = res.data.userCount;
});
},
// 获取产品详情
getBargainDetail: function() {
var that = this;
getBargainDetail(that.bargainId)
.then(res => {
res.data.bargain = res.data.bargain.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.bargain = res.data.bargain;
that.datatime = that.bargain.stopTime / 1000;
that.getBargainHelpCount();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//开启砍价
getBargainStart: function() {
var that = this;
getBargainStart({ bargainId: that.bargainId })
.then(() => {
that.bargainPartake = that.userInfo.uid;
that.getBargainHelp();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//参与砍价
getBargainHelp: function() {
var that = this;
if (
that.surplusPrice === 0 &&
that.bargainPartake !== that.userInfo.uid
) {
return uni.showToast({
title: "好友已经砍价成功",
icon: "success",
duration: 2000
});
}
var data = {
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
};
getBargainHelp(data)
.then(res => {
that.activeMsg = res.data.status;
if (
res.data.status === "SUCCESSFUL" &&
that.bargainPartake !== that.userInfo.uid
) {
uni.showToast({
title: "您已经砍过了",
icon: "none",
duration: 2000
});
return;
}
that.helpListStatus = false;
that.page = 1;
that.bargainHelpList = [];
that.getBargainHelpPrice();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//获取砍掉的金额
getBargainHelpPrice: function() {
var that = this;
getBargainHelpPrice({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.bargainHelpPrice = res.data.price;
that.getBargainHelpCount();
that.getBargainHelpList();
switch (that.activeMsg) {
case "SUCCESSFUL":
break;
case "SUCCESS":
that.active = true;
break;
}
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//砍价帮
getBargainHelpList: function() {
var that = this;
if (that.helpListLoading === true) return;
if (that.helpListStatus === true) return;
that.helpListLoading = true;
getBargainHelpList({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake,
page: that.page,
limit: that.limit
})
.then(res => {
that.helpListStatus = res.data.length < that.limit;
that.helpListLoading = false;
that.page++;
that.bargainHelpList.push.apply(that.bargainHelpList, res.data);
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
getBargainHelpCountStart: function() {
var that = this;
getBargainHelpCount({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(() => {})
.catch(() => {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: { id: that.bargainId, partake: that.userInfo.uid }
});
// that.$router.push({
// path:
// "/activity/dargain_detail/" +
// that.bargainId +
// "/" +
// that.userInfo.uid
// });
});
},
getBargainHelpCount: function() {
var that = this;
getBargainHelpCount({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.userBargainStatus = res.data.status;
that.helpCount = res.data.count;
that.surplusPrice = res.data.price;
that.alreadyPrice = res.data.alreadyPrice;
that.pricePercent = res.data.pricePercent;
that.price = (that.bargain.price - that.alreadyPrice).toFixed(2);
console.log(that);
})
.catch(() => {
that.bargainPartake = that.userInfo.uid;
// that.$yrouter.push({
// path: "/pages/activity/DargainDetails/index",
// query: { id: that.bargainId, partake: that.userInfo.uid }
// });
});
},
getBargainStartUser: function() {
var that = this;
getBargainStartUser({
bargainId: that.bargainId,
bargainUserUid: that.bargainPartake
})
.then(res => {
that.bargainUserInfo = res.data;
that.getBargainHelpList();
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
close: function() {
this.active = false;
}
}
// ,
// onShareAppMessage() {
// return {
// path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`
// };
// }
};
</script>
<style lang="less">
page {
background-color: #eb3729;
}
.bargainBnt_hui {
font-size: 0.3 * 100rpx;
font-weight: bold;
color: #fff;
width: 6 * 100rpx;
height: 0.8 * 100rpx;
border-radius: 0.4 * 100rpx;
background: #bbb;
text-align: center;
line-height: 0.8 * 100rpx;
margin-top: 0.32 * 100rpx;
}
.bargain_view {
left: 0;
right: 0;
height: 0.48 * 100rpx;
background: rgba(0, 0, 0, 0.5);
opacity: 1;
border-radius: 0 0 0.06 * 100rpx 0.06 * 100rpx;
position: absolute;
bottom: 0;
font-size: 0.22 * 100rpx;
color: #fff;
text-align: center;
line-height: 0.48 * 100rpx;
}
.iconfonts {
font-size: 0.22 * 100rpx;
}
</style>
+84
View File
@@ -0,0 +1,84 @@
<template>
<view class="bargain-list">
<!-- <view class="header">
<image src="@/static/images/cut-bg.png" alt="">
</view>-->
<view class="list" v-if="bargainLis.length > 0">
<view class="item acea-row row-between-wrapper" v-for="(item, bargainLisIndex) in bargainLis"
:key="bargainLisIndex">
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-around">
<view class="line1" v-text="item.title"></view>
<view class="num">
<text class="iconfont icon-pintuan"></text>
{{ item.people }}人正在参与
</view>
<view class="money font-color-red">
可砍至:
<text class="price">{{item.minPrice}}</text>
</view>
</view>
<view class="cutBnt bg-color-red" @click="goDetail(item.id)">
<text class="iconfont icon-kanjia"></text>参与砍价
</view>
</view>
<view class="load font-color-red" v-if="!status" @click="getBargainList">点击加载更多</view>
</view>
</view>
</template>
<script>
import {
getBargainList
} from "@/api/activity";
export default {
name: "GoodsBargain",
components: {},
props: {},
data: function() {
return {
bargainLis: [], //砍价列表
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20 //数量
};
},
mounted: function() {
this.getBargainList();
},
methods: {
getBargainList: function() {
var that = this;
if (that.loading) return;
if (that.status) return;
that.loading = true;
getBargainList({
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.bargainLis.push.apply(that.bargainLis, res.data);
that.page++;
that.loading = false;
});
},
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",
query: {
id,
partake: 0
}
});
}
}
};
</script>
<style>
page {
background-color: rgb(245, 245, 245);
}
</style>
+91
View File
@@ -0,0 +1,91 @@
<template>
<view class="group-list" ref="container">
<view class="list" v-if="combinationList.length>0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, combinationListIndex) in combinationList"
:key="combinationListIndex"
@click="link(item.id)"
>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text">
<view class="line1" v-text="item.title"></view>
<view class="acea-row">
<view class="team acea-row row-middle cart-color">
<view class="iconfont icon-pintuan"></view>
<view class="num" v-text="item.people + '人团'"></view>
</view>
</view>
<view class="bottom acea-row row-between-wrapper">
<view class="money">
<text class="num" v-text="item.price"></text>
<text class="y-money" v-text="'¥' + item.productPrice"></text>
</view>
<view class="groupBnt bg-color-red">
去拼团
<text class="iconfont icon-jiantou"></text>
</view>
</view>
</view>
</view>
<Loading :loaded="status" :loading="loadingList"></Loading>
</view>
<view class="noCommodity" style="background-color: #fff;" v-if="combinationList.length === 0">
<view class="noPictrue">
<image :src="webUrl+'/20210203153900181449.png'" class="image" />
</view>
</view>
</view>
</template>
<script>
import { getCombinationList } from "@/api/activity";
import Loading from "@/components/Loading";
export default {
name: "GoodsGroup",
components: {
Loading
},
props: {},
data: function() {
return {
webUrl:this.$VUE_APP_RESOURCES_URL,
combinationList: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loading: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20, //数量
loadingList: false
};
},
mounted: function() {
// document.querySelector('body').setAttribute('style', 'background-color:#eb3729');
this.getCombinationList();
},
onReachBottom() {
!this.loadingList && this.getCombinationList();
},
methods: {
getCombinationList: function() {
var that = this;
if (that.loading) return;
if (that.status) return;
getCombinationList({ page: that.page, limit: that.limit }).then(res => {
that.status = res.data.length < that.limit;
that.combinationList.push.apply(that.combinationList, res.data);
that.page++;
that.loading = false;
});
},
link: function(id) {
this.$yrouter.push({
path: "/pages/activity/GroupDetails/index",
query: { id }
});
}
}
};
</script>
+261
View File
@@ -0,0 +1,261 @@
<template>
<view class="flash-sale" ref="container">
<view class="header" v-if="headerImg">
<image :src="headerImg"/>
</view>
<scroll-view scroll-y="false" scroll-x="true">
<view class="timeScroll">
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active==index" class="timeItem active" @click="setTime(index)">
<view class="time">{{ item.time }}</view>
<view class="state">{{ item.state }}</view>
</view>
<view v-if="active!=index" class="timeItem" @click="setTime(index)">
<view class="time">{{ item.time }}</view>
<view class="state">{{ item.state }}</view>
</view>
</view>
</view>
</scroll-view>
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active == index">
<view class="countDown font-color-red acea-row row-center-wrapper">
<view v-if="item.status === 0" class="activity">活动已结束</view>
<count-down
:isDay="false"
:tipText="'距结束仅剩 '"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
v-if="item.status === 1"
></count-down>
<view v-if="item.status === 2" class="activity">活动即将开始</view>
</view>
<view class="list">
<view
class="item acea-row row-between-wrapper"
v-for="(itemSeckill, indexSeckill) in seckillList"
:key="indexSeckill"
>
<view class="pictrue">
<image :src="itemSeckill.image"/>
</view>
<view class="text acea-row row-column-around">
<view class="line1" v-text="itemSeckill.title"></view>
<view class="money">
限时价
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
</view>
<view class="progress cart-color">
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
</view>
</view>
<view
class="grab bg-color-red"
v-if="item.status === 1 && itemSeckill.stock > 0"
@click="goDetail(itemSeckill.id)"
>马上抢
</view>
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
</view>
</view>
<view
class="noCommodity"
style="background-color: #fff;"
v-if="seckillList.length === 0 && page > 1"
>
<view class="noPictrue">
<image :src="webUrl+'/20210203153900181449.png'" class="image"/>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {getSeckillConfig, getSeckillList} from "@/api/activity";
import CountDown from "@/components/CountDown";
export default {
name: "GoodsSeckill",
components: {
CountDown
},
props: {},
data: function () {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
headerImg: "",
timeList: [],
sticky: false,
loading: false,
datatime: 0,
active: 0,
seckillList: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 5, //数量
title: []
};
},
mounted: function () {
this.mountedStart();
},
onReachBottom() {
!this.loadingList && this.getSeckillList();
},
methods: {
changeTime: function (index) {
this.active = index;
this.getSeckillList();
},
mountedStart: function () {
var that = this;
uni.showLoading();
getSeckillConfig().then(res => {
that.$set(that, "headerImg", res.data.lovely);
that.$set(that, "timeList", res.data.seckillTime);
that.$set(that, "active", res.data.seckillTimeIndex);
let title = [];
title = res.data.seckillTime.map((item, index) => {
return {
name: "div",
attrs: {
class: "timeItem"
},
children: [
{
name: "div",
attrs: {
class: "time"
},
children: [
{
type: "text",
text: item.time
}
]
},
{
name: "div",
attrs: {
class: "state"
},
children: [
{
type: "text",
text: item.state
}
]
}
]
};
});
that.$set(that, "title", title);
that.datatime = that.timeList[that.active].stop;
that.getSeckillList();
that.$nextTick(function () {
that.sticky = true;
uni.hideLoading();
});
});
},
setTime: function (index) {
var that = this;
that.page = 1;
that.loadingList = false;
that.status = false;
that.active = index;
that.datatime = that.timeList[that.active].stop;
this.seckillList = [];
that.getSeckillList();
},
getSeckillList: function () {
var that = this;
if (that.loadingList) return;
if (that.status) return;
var time = that.timeList[that.active].id;
getSeckillList(time, {
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.seckillList.push.apply(that.seckillList, res.data);
that.page++;
uni.hideLoading();
});
},
goDetail: function (id) {
var that = this;
var time = that.timeList[that.active].stop;
this.$yrouter.push({
path: "/pages/activity/SeckillDetails/index",
query: {
id,
time
}
});
}
}
};
</script>
<style scoped lang="less">
.timeScroll {
display: flex;
align-items: center;
flex-direction: row;
}
.timeItem {
font-size: 0.22 * 100rpx;
color: #282828;
width: 150rpx;
text-align: center;
padding: 0.11 * 100rpx 0;
background-color: none;
&.active {
.time {
color: #eb3729;
}
.state {
background-color: #eb3729;
color: #fff;
opacity: 1;
border-radius: 30rpx;
padding: 0 0.2 * 100rpx;
font-weight: 800;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
}
}
.timeItem .time {
font-size: 0.32 * 100rpx;
font-weight: bold;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.timeItem .state {
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.activity {
color: #333;
}
.flash-sale .list .item .grab {
background-color: #999;
}
</style>
+375
View File
@@ -0,0 +1,375 @@
<template>
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
<view class="wrapper">
<view class="share acea-row row-between row-bottom">
<view class="money font-color-red">
<text class="num" v-text="storeInfo.price"></text>
<text class="y-money" v-text="'¥' + storeInfo.productPrice"></text>
</view>
</view>
<view class="introduce" v-text="storeInfo.title"></view>
<view class="label acea-row row-between-wrapper">
<view v-text="'类型:' + storeInfo.people + '人团'"></view>
<view v-text="'库存:' + storeInfo.stock + storeInfo.unitName"></view>
<view v-text="'已拼:' + storeInfo.sales + storeInfo.unitName"></view>
</view>
</view>
<view class="notice acea-row row-middle">
<view class="num font-color-red">
<text class="iconfont icon-laba"></text>
已拼{{ storeInfo.sales
}}{{ storeInfo.unitName }}
<text class="line">|</text>
</view>
<view class="swiper-no-swiping swiper">
<swiper class="swiper-wrapper" :options="swiperTip" :autoplay="true" :interval="3000">
<block v-for="(item, itemNewIndex) in itemNew" :key="itemNewIndex">
<swiper-item>
<view class="line1">{{ item }}</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="assemble">
<view v-for="(item, groupListindex) in groupList" :key="groupListindex">
<view class="item acea-row row-between-wrapper" v-if="groupListindex < groupListCount">
<view class="pictxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.avatar" class="image" />
</view>
<view class="text line1" v-text="item.nickname"></view>
</view>
<view class="right acea-row row-middle">
<view>
<view class="lack">
<text>还差</text>
<text class="font-color-red" v-text="item.count"></text>
<text>人成团</text>
</view>
<count-down
:isDay="false"
:tipText="'剩余 '"
:dayText="false"
:hourText="':'"
:minuteText="':'"
:secondText="false"
:datatime="item.stopTime/1000"
></count-down>
</view>
<view class="spellBnt" @click="groupRule(item.id)">
去拼单
<text class="iconfont icon-jiantou"></text>
</view>
</view>
</view>
</view>
<view class="more" v-if="groupList.length > groupListCount" @click="setGroupListCount">
查看更多
<text class="iconfont icon-xiangxia"></text>
</view>
</view>
<view class="playWay">
<view class="title acea-row row-between-wrapper">
<view>拼团玩法</view>
</view>
<view class="way acea-row row-middle">
<view class="item">
<text class="num"></text>开团/参团
</view>
<view class="iconfont icon-arrow"></view>
<view class="item">
<text class="num"></text>邀请好友
</view>
<view class="iconfont icon-arrow"></view>
<view class="item">
<view>
<text class="num"></text>满员发货
</view>
</view>
</view>
</view>
<view class="userEvaluation">
<view class="title acea-row row-between-wrapper">
<view v-text="'用户评价(' + replyCount + ')'"></view>
<view class="praise" @click="goReply">
<text class="font-color-red" v-text="replyChance + '%'"></text>好评率
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<UserEvaluation :reply="reply"></UserEvaluation>
</view>
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
<!-- <view class="conter" v-html=""></view> -->
</view>
<view style="height:100rpx;"></view>
<view class="footer-group acea-row row-between-wrapper">
<!-- <view class="customerSer acea-row row-center-wrapper row-column">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>-->
<view class="customerSer acea-row row-center-wrapper row-column" @click="setCollect">
<view class="iconfont" :class="userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text>
</view>
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
<view class="bnt bg-color-red" @click="openTeam">立即开团</view>
</view>
<ProductWindow v-if="cartNum" v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
</view>
</template>
<script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import UserEvaluation from "@/components/UserEvaluation";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getCombinationDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "GroupDetails";
export default {
name: "GroupDetails",
components: {
ProductConSwiper,
CountDown,
UserEvaluation,
// swiper,
// swiperSlide,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
reply: [],
replyCount: 0,
replyChance: 0,
imgUrls: [],
storeInfo: {},
itemNew: {},
groupListCount: 2,
groupList: {},
swiperTip: {
direction: "vertical",
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
},
attr: {
cartAttr: false,
productSelect: {
image: "",
store_name: "",
price: "",
stock: "",
unique: "",
cart_num: 1
}
},
cartNum: 1,
userCollect: false
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
onShow: function() {
this.mountedStart();
},
methods: {
openAlone: function() {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: this.storeInfo.productId }
});
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
},
//收藏商品
setCollect: function() {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function() {
that.userCollect = !that.userCollect;
});
} else {
getCollectAdd(id, category).then(function() {
that.userCollect = !that.userCollect;
});
}
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "itemNew", res.data.pinkOkList);
that.$set(that, "groupList", res.data.pink);
that.$set(that, "reply", [res.data.reply]);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "replyChance", res.data.replyChance);
that.setProductSelect();
that.posterData.image = that.storeInfo.image;
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.domStatus = true;
//that.getImageBase64();
});
},
getImageBase64: function() {
let that = this;
imageBase64(this.posterData.image, that.posterData.code).then(res => {
that.posterData.image = res.data.image;
that.posterData.code = res.data.code;
});
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
groupRule: function(id) {
var that = this;
that.$yrouter.push({
path: "/pages/activity/GroupRule/index",
query: { id }
});
},
goReply: function() {
var that = this;
that.$yrouter.push({
path: "/pages/shop/EvaluateList/index",
query: { id: that.storeInfo.product_id }
});
},
setGroupListCount: function() {
this.groupListCount = this.groupListCount + 2;
},
//将父级向子集多次传送的函数合二为一;
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
that.attr.productSelect.cart_num = 1;
that.cartNum = 1;
uni.showToast({
title: "每人每次限购1" + that.storeInfo.unitName,
icon: "none",
duration: 2000
});
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price;
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
that.$set(that, "attr", attr);
},
openTeam: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.cartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.combinationId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
}
};
</script>
<style scoped lang="less">
.product-con .wrapper {
padding-bottom: 0.26 * 100rpx;
}
.noscroll {
height: 100%;
overflow: hidden;
}
.product-con .footer-group .bnt {
// flex:1;
width: 43%;
}
.product-con .footer-group .bnt.bg-color-violet {
background-color: #fa8013;
}
</style>
+248
View File
@@ -0,0 +1,248 @@
<template>
<view class="group-con">
<view class="header acea-row row-between-wrapper">
<view class="pictrue">
<image :src="storeCombination.image" />
</view>
<view class="text">
<view class="line1" v-text="storeCombination.title"></view>
<view class="money">
<text></text>
<text class="num" v-text="storeCombination.price"></text>
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text>
</view>
</view>
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view>
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view>
</view>
<view class="wrapper">
<view class="title acea-row row-center-wrapper">
<view class="line"></view>
<view class="name acea-row row-center-wrapper">
<text>剩余</text>
<count-down
:isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="pinkT.stopTime/1000"
></count-down>
<text>结束</text>
</view>
<view class="line"></view>
</view>
<view class="tips-warp">
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text>
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}拼团失败</text>
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中还差{{ count }}人拼团成功</text>
</view>
<view
class="list acea-row row-middle"
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"
>
<view class="pictrue">
<image :src="pinkT.avatar" />
</view>
<view class="acea-row row-middle" v-if="pinkAll.length > 0">
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex">
<image :src="item.avatar" />
</view>
</view>
<view class="pictrue" v-for="countIndex in count" :key="countIndex">
<image class="img-none" :src="webUrl+'/20230304204903336964.png'" />
</view>
</view>
<view
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
class="lookAll acea-row row-center-wrapper"
@click="lookAll"
>
{{ iShidden ? "收起" : "查看全部" }}
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
</view>
<view
class="teamBnt bg-color-red"
v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
@click="goPoster"
>邀请好友参团</view>
<view
class="teamBnt bg-color-red"
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
@click="pay"
>我要参团</view>
<view
class="teamBnt bg-color-red"
v-if="pinkBool === 1 || pinkBool === -1"
@click="goDetail(storeCombination.id)"
>再次开团</view>
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
<text class="iconfont icon-guanbi3"></text>
<text>取消开团</text>
</view>
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
<text>查看订单信息</text>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
</template>
<script>
import CountDown from "@/components/CountDown";
import { getCombinationPink, getCombinationRemove } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
const NAME = "GroupRule";
export default {
name: NAME,
components: {
CountDown
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
currentPinkOrder: "", //当前拼团订单
isOk: 0, //判断拼团是否完成
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
pinkAll: [], //团员
pinkT: [], //团长信息
storeCombination: [], //拼团产品
pinkId: 0,
count: 0, //拼团剩余人数
iShidden: false
};
},
watch: {
$yroute(n) {
var that = this;
if (n.name === NAME) {
that.pinkId = that.$yroute.query.id;
that.getCombinationPink();
}
}
},
mounted: function() {
var that = this;
let url = handleQrCode();
if (url) {
that.pinkId = url.pinkId;
} else {
that.pinkId = that.$yroute.query.id;
}
that.getCombinationPink();
},
methods: {
pay: function() {
var that = this;
var data = {};
data.productId = that.storeCombination.productId;
data.cartNum = that.pinkT.totalNum;
data.uniqueId = "";
data.combinationId = that.storeCombination.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId,
pinkid: that.pinkId
}
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
goPoster: function() {
var that = this;
this.$yrouter.push({
path: "/pages/activity/Poster/index",
query: {
id: that.pinkId,
type: 1
}
});
},
goOrder: function() {
var that = this;
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
query: {
id: that.currentPinkOrder
}
});
},
//拼团列表
goList: function() {
this.$yrouter.push({
path: "/pages/activity/GoodsGroup/index"
});
},
//拼团详情
goDetail: function(id) {
this.$yrouter.push({
path: "/pages/activity/GroupDetails/index",
query: {
id
}
});
},
//拼团信息
getCombinationPink: function() {
var that = this;
getCombinationPink(that.pinkId).then(res => {
that.$set(that, "storeCombination", res.data.storeCombination);
that.$set(that, "pinkT", res.data.pinkT);
that.$set(that, "pinkAll", res.data.pinkAll);
that.$set(that, "count", res.data.count);
that.$set(that, "userBool", res.data.userBool);
that.$set(that, "pinkBool", res.data.pinkBool);
that.$set(that, "isOk", res.data.isOk);
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
});
},
//拼团取消
getCombinationRemove: function() {
var that = this;
getCombinationRemove({
id: that.pinkId,
cid: that.storeCombination.id
})
.then(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
lookAll: function() {
this.iShidden = !this.iShidden;
}
}
};
</script>
<style lang="less">
.tips-warp {
text-align: center;
margin-top: 20rpx;
}
</style>
+79
View File
@@ -0,0 +1,79 @@
<template>
<view class="poster-poster" v-if="status === false">
<view class="tip">
<text class="iconfont icon-shuoming"></text>提示长按图片保存至手机相册
</view>
<view class="poster">
<image :src="image" mode="widthFix" show-menu-by-longpress />
</view>
</view>
</template>
<script>
import { getBargainPoster, getCombinationPoster } from "@/api/activity";
export default {
name: "Poster",
components: {},
props: {},
data: function() {
return {
status: true,
id: 0,
image: ""
};
},
mounted: function() {
var that = this;
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function() {
var that = this;
getBargainPoster({ bargainId: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
// 拼团海报
getCombinationPoster: function() {
var that = this;
getCombinationPoster({ id: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
<style scoped lang="less">
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
</style>
+235
View File
@@ -0,0 +1,235 @@
<template>
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
<view class="nav acea-row row-between-wrapper">
<view class="money">
<text class="num" v-text="storeInfo.price"></text>
<text class="y-money" v-text="'¥' + storeInfo.price"></text>
</view>
<view class="acea-row row-middle">
<view class="times">
<view>距秒杀结束仅剩</view>
<count-down
:isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
></count-down>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
</view>
<view class="wrapperRush">
<view class="introduce acea-row row-between">
<view class="infor" v-text="storeInfo.title"></view>
<!-- <view class="iconfont icon-fenxiang" @click="setPosterImageStatus"></view> -->
</view>
<view class="label acea-row row-middle">
<view class="stock" v-text="'库存:' + storeInfo.stock + '件'"></view>
<view v-text="'销量:' + storeInfo.sales + '件'"></view>
</view>
</view>
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
</view>
<view style="height:100rpx;"></view>
<view class="footerRush acea-row row-between-wrapper">
<!-- <view
class="customerSer acea-row row-center-wrapper row-column"
@click="routerGo()"
>
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view> -->
<view class="bnt bg-color-red" @click="tapBuy">立即购买</view>
</view>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
</view>
</template>
<style scoped lang="less">
.noscroll {
height: 100%;
overflow: hidden;
}
</style>
<script>
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getSeckillDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
const NAME = "SeckillDetails";
export default {
name: "SeckillDetails",
components: {
ProductConSwiper,
CountDown,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
action: "",
imgUrls: [],
storeInfo: [],
replyCount: 0,
reply: [],
cartNum: 1,
attr: {
cartAttr: false,
productSelect: {
image: "",
store_name: "",
price: "",
stock: "",
unique: "",
cart_num: 1
}
},
datatime: 0
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
mounted: function() {
this.mountedStart();
},
methods: {
routerGo(item) {
this.$yrouter.push({ path: '/pages/user/CustomerList/index' })
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => {
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "reply", res.data.reply);
that.posterData.image = that.storeInfo.image_base;
that.updateTitle();
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.setProductSelect();
that.domStatus = true;
});
},
updateTitle() {
// document.title = this.storeInfo.title || this.$yroute.meta.title;
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
//将父级向子集多次传送的函数合二为一;
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
if (res) {
if (that.attr.productSelect.cart_num < that.storeInfo.stock) {
that.attr.productSelect.cart_num++;
this.cartNum++;
}
} else {
if (that.attr.productSelect.cart_num > 1) {
that.attr.productSelect.cart_num--;
this.cartNum--;
}
}
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price;
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
that.$set(that, "attr", attr);
},
selecAttrTap: function() {
this.cartAttr = true;
},
tapBuy: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.secKillId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
}
}
}
};
</script>
<style scoped lang="less">
.product-con .nav {
padding: 0 0.2*100rpx;
}
</style>
+58 -193
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="pages-auth v12-justify-between v12-flex-column"> <view class="pages-auth">
<!-- <view class="tip-1">为了提供更优质的服务需要获取</view> <view class="tip-1">为了提供更优质的服务需要获取</view>
<view class="tip-2">您的头像昵称</view> <view class="tip-2">您的头像昵称</view>
<view class="wechat flex jc-between ai-center"> <view class="wechat flex jc-between ai-center">
@@ -12,9 +12,18 @@
</view> </view>
</view> </view>
<image class="select" :src="webUrl+'/20220613104953149068.png'" mode="scaleToFill"/> <image class="select" :src="webUrl+'/20220613104953149068.png'" mode="scaleToFill"/>
</view> --> </view>
<view class="agree-box">
<checkbox-group @change="changeAgree">
<label>
<checkbox value="yes" style="transform:scale(0.8)"/>
</label>
<text @click="changeShow">我已阅读并同意
<text class="btn-show">用户服务协议及隐私政策</text>
</text>
</checkbox-group>
</view>
<view class="dialog-mask" v-if="show"> <view class="dialog-mask" v-if="show">
<view class="dialog-body"> <view class="dialog-body">
@@ -31,130 +40,19 @@
<view class="dialog-mask" v-if="showFillOut"> <view class="dialog-mask" v-if="showFillOut">
<view class="dialog-fill flex flex-col ai-center"> <view class="dialog-fill flex flex-col ai-center">
<!-- <view class="title bold">请完善您的信息</view> --> <view class="title bold">请完善您的头像和昵称</view>
<view class="v12-align-center v12-justify-start v12-py-4" style="width:550rpx"> <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<view class="v12-mr-3"> <image class="avatar" :src="avatarUrl"></image>
<image class="app-logo__image--inner" :src="webUrl+'/orderIcon/applogo.png'" mode="aspectFit|aspectFill|widthFix" lazy-load="true"></image> </button>
</view> <input type="nickname" class="input-wrapper" placeholder="请输入昵称" @input="inputName" @confirm="inputName"
<view class="v12-dark-text v12-font-bold"> @blur="inputName"/>
<text class="v12-font-40"> <view class="btn-submit" @click="onSubmit">确认</view>
地标文化特产
</text>
<text class="v12-mx-1">
|
</text>
<text class="v12-font-24">
申请使用
</text>
</view>
</view>
<view class="v12-dark-text v12-font-40 v12-mt-3 v12-font-bold" style="width:550rpx">
获取你的昵称头像
</view>
<view class="v12-align-center v12-justify-between v12-mb-3 v12-mt-6" style="width:550rpx">
<view class="v12-align-center">
<view class="v12-dark-text v12-mr-3">
头像
</view>
<button
class="avatar-wrapper v12-ma-0"
open-type="chooseAvatar"
@chooseavatar="onChooseAvatar"
>
<image
:src="avatarUrl"
class="avatar"
/>
</button>
</view>
<view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="v12-align-center v12-justify-between v12-my-4" style="width:550rpx">
<view class="v12-align-center">
<view class="v12-dark-text v12-mr-3">
昵称
</view>
<input
type="nickname"
maxlength="12"
class="input-wrapper "
placeholder="请填写您的昵称"
v-model="nickname"
@input="inputName"
@confirm="inputName"
@blur="inputName"
/>
</view>
<view>
<u-icon name="close" @click="clearName"></u-icon>
</view>
</view>
<!-- <view class="input-wrapper">
<picker
:value="form.birthday"
mode="date"
class="picker"
@change="birthdayChange"
>
{{ form.birthday || '请选择出生日期' }}
</picker>
</view> -->
<!-- <view class="gender-row">
性别
<u-radio-group
v-model="form.gender"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="#C41617"
label="男"
/>
<u-radio
:name="2"
active-color="#C41617"
label="女"
/>
</u-radio-group>
</view> -->
<view class="v12-justify-between v12-py-6 " style="width: 550rpx">
<view class="v12-primary-border v12-primary v12-white-text v12-btn v12-px-8 v12-py-1" @click="onSubmit">允许</view>
<view class="v12-dark-border v12-dark-text v12-btn v12-px-8 v12-py-1" @click="back">拒绝</view>
</view>
</view> </view>
</view> </view>
<view class="app-logo v12-align-center v12-flex-column">
<image class="app-logo__image" :src="webUrl+'/orderIcon/applogo.png'" mode="aspectFit|aspectFill|widthFix" lazy-load="true"></image>
<view class="v12-mt-3 v12-font-32 v12-dark-text v12-font-weight-600">发现家乡好物</view>
</view>
<view class="btn-box"> <view class="btn-box">
<button class="btn-yes v12-primary" type="mini" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">快捷登录</button> <button class="btn-yes" type="default" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">同意</button>
<!-- <button class="btn-no" type="default" @tap="back">拒绝</button> --> <button class="btn-no" type="default" @tap="back">拒绝</button>
</view>
<view class="agree-box v12-align-center">
<u-checkbox-group
@change="changeAgree"
v-model="isAgree"
>
<u-checkbox
activeColor="#C52733"
size="16"
name="yes"
>
</u-checkbox>
</u-checkbox-group>
<text @click="changeShow">我已阅读并同意
<text class="btn-show">用户服务协议及隐私政策</text>
</text>
<!-- <checkbox-group @change="changeAgree">
<label>
<checkbox value="yes" style="transform:scale(0.6)" iconColor="#C52733" />
</label>
</checkbox-group> -->
</view> </view>
</view> </view>
</template> </template>
@@ -163,8 +61,10 @@
import {mapActions, mapMutations, mapState} from 'vuex' import {mapActions, mapMutations, mapState} from 'vuex'
import cookie from '@/utils/store/cookie' import cookie from '@/utils/store/cookie'
import {login, uploadImage} from '@/utils' import {login, uploadImage} from '@/utils'
import {getAgree} from "@/api/public" import {getAgree} from "@/api/public";
import {postUserEdit} from "@/api/user" import {postUserEdit} from "@/api/user";
const defaultAvatarUrl = "/20230506100714762257.png"
export default { export default {
data() { data() {
@@ -173,15 +73,12 @@ export default {
authorize: false, authorize: false,
canIUseGetUserProfile: false, canIUseGetUserProfile: false,
agreeInfo: {}, agreeInfo: {},
isAgree: [], isAgree: false,
show: false, show: false,
showFillOut: false, showFillOut: false,
nickname: '', nickname: "",
avatarUrl: this.$VUE_APP_RESOURCES_URL + '/20230506100714762257.png', avatarUrl: this.$VUE_APP_RESOURCES_URL + defaultAvatarUrl,
form: {
gender: '',
birthday: ''
}
} }
}, },
computed: { computed: {
@@ -209,10 +106,7 @@ export default {
this.show=!this.show; this.show=!this.show;
}, },
changeAgree(event) { changeAgree(event) {
this.isAgree = event this.isAgree = event.detail.value.length > 0
},
clearName() {
this.nickname = ''
}, },
toLogin() { toLogin() {
this.$yrouter.push({ this.$yrouter.push({
@@ -238,7 +132,7 @@ export default {
}) })
}, },
getUserInfoProfile() { getUserInfoProfile() {
if (!this.isAgree[0]) { if (!this.isAgree) {
uni.showToast({ uni.showToast({
title: "请先阅读并同意《用户服务协议及隐私政策》", title: "请先阅读并同意《用户服务协议及隐私政策》",
icon: "none", icon: "none",
@@ -280,10 +174,6 @@ export default {
inputName(e) { inputName(e) {
this.nickname = e.detail.value; this.nickname = e.detail.value;
}, },
birthdayChange(e) {
const value = e.detail.value
this.form.birthday = value
},
onSubmit() { onSubmit() {
let that = this; let that = this;
@@ -315,11 +205,9 @@ export default {
}, },
saveUserInfo() { saveUserInfo() {
const param = { let param = {
nickname: this.nickname, nickname: this.nickname,
avatar: this.avatarUrl, avatar: this.avatarUrl
gender: this.form.gender || 0,
birthday: this.form.birthday || ''
} }
postUserEdit(param).then(res => { postUserEdit(param).then(res => {
if (res.status === 200) { if (res.status === 200) {
@@ -344,20 +232,10 @@ export default {
} }
</script> </script>
<style lang="less"> <style lang="scss">
.app-logo{
margin-top: 70rpx;
}
.app-logo__image--inner{
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.pages-auth { .pages-auth {
padding: 148rpx 48rpx; padding: 148rpx 48rpx;
padding: 148rpx 48rpx;
height: 100vh;
box-sizing: border-box;
.tip-1 { .tip-1 {
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
@@ -401,12 +279,12 @@ export default {
} }
.agree-box { .agree-box {
// margin: 200rpx 0 60rpx; margin: 200rpx 0 60rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #666;
padding: 0 20rpx;
.btn-show { .btn-show {
color: #4099FF; color: #000;
} }
} }
@@ -424,7 +302,7 @@ export default {
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 686rpx; width: 630rpx;
height: 70vh; height: 70vh;
box-sizing: border-box; box-sizing: border-box;
padding: 60rpx; padding: 60rpx;
@@ -457,7 +335,8 @@ export default {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
width: 686rpx; width: 516rpx;
height: 576rpx;
border-radius: 24rpx; border-radius: 24rpx;
background: #fff; background: #fff;
@@ -469,14 +348,15 @@ export default {
} }
.avatar-wrapper { .avatar-wrapper {
width: 80rpx; width: 180rpx;
height: 80rpx; height: 180rpx;
margin-top: 38rpx;
padding: 0; padding: 0;
background: none; background: none;
.avatar { .avatar {
width: 80rpx; width: 180rpx;
height: 80rpx; height: 180rpx;
border-radius: 50%; border-radius: 50%;
} }
} }
@@ -486,28 +366,21 @@ export default {
} }
.input-wrapper { .input-wrapper {
width: 360rpx;
height: 72rpx; height: 72rpx;
margin-top: 32rpx;
background: rgba(248, 249, 251, 1); background: rgba(248, 249, 251, 1);
color: #999; color: #999;
font-size: 32rpx; font-size: 32rpx;
text-align: left;
border-radius: 40rpx;
padding: 0 20rpx;
}
.gender-row {
display: flex;
align-items: center;
margin-top: 32rpx;
}
.picker {
text-align: center; text-align: center;
line-height: 72rpx;
} }
.btn-submit { .btn-submit {
position: absolute;
bottom: 0;
left: 0;
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
margin: 32rpx 0 0 0;
box-sizing: border-box; box-sizing: border-box;
border-top: 2rpx solid #E0E0E0; border-top: 2rpx solid #E0E0E0;
color: #3A87FC; color: #3A87FC;
@@ -519,10 +392,9 @@ export default {
} }
.btn-box { .btn-box {
// width: 338rpx; width: 338rpx;
// margin: 0 auto; margin: 0 auto;
padding: 0 20rpx;
padding-bottom: 340rpx;
button::after { button::after {
border: none; border: none;
} }
@@ -533,10 +405,8 @@ export default {
} }
.btn-yes { .btn-yes {
background: #FF564A;
color: #fff; color: #fff;
width: 100%;
border-radius: 40rpx;
letter-spacing: 1px;
} }
.btn-no { .btn-no {
@@ -546,9 +416,4 @@ export default {
} }
} }
} }
.app-logo__image{
width: 200rpx;
height: 200rpx;
border-radius: 50%;
}
</style> </style>
+130 -857
View File
File diff suppressed because it is too large Load Diff
+49 -109
View File
@@ -57,20 +57,9 @@
@click="bannerItemTapHandle(banner)" @click="bannerItemTapHandle(banner)"
/> />
</view> </view>
<!--全国特产和文玩的推荐信息--> <!--9-2 推荐信息-->
<view <view class="recommendInfo" v-if="recommendInfo && type < 2">
v-if="recommendInfo && type < 2" <template v-if="(type === 0 && recommendInfo.hotelList) || (type === 1 && recommendInfo.productList)">
class="recommendInfo"
>
<!--bug#1060-增加控制-->
<template
v-if="recommendInfo.displayStatus === 1 &&
(
(type === 0 && recommendInfo.hotelList) ||
(type === 1 && recommendInfo.productList)
)
"
>
<view class="red-border-title">{{ recommendInfo.title }}</view> <view class="red-border-title">{{ recommendInfo.title }}</view>
<image <image
:src="recommendInfo.backgroundImage" :src="recommendInfo.backgroundImage"
@@ -137,31 +126,33 @@
</template> </template>
<script> <script>
import MescrollMixins from '@/mixins/mescroll-mixins.js' import MescrollMixins from "@/mixins/mescroll-mixins.js";
import {fetchCity} from '@/api/wenwan' import {fetchCity} from "@/api/wenwan";
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue' import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
import {getCurAddress, getLocation} from '@/utils/common.js' import {getCurAddress, getLocation} from "@/utils/common.js";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'ChoseCity', name: "choseCity",
components: { components: {
MescrollBody MescrollBody
}, },
props: {},
mixins: [ mixins: [
MescrollMixins({ MescrollMixins({
getPageData(mescroll) { getPageData(mescroll) {
mescroll.endSuccess(10) // 此时mescroll会携带page的参数:
// let pageNum = mescroll.num; // 页码, 默认从1开始
// let pageSize = mescroll.size; // 页长, 默认每页10条
mescroll.endSuccess(10);
} }
}), })
pageListenMixins
], ],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
upOption: { upOption: {
// 如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5 noMoreSize: 10, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
noMoreSize: 10,
auto: false, auto: false,
empty: { empty: {
tip: '暂无城市' tip: '暂无城市'
@@ -171,47 +162,23 @@ export default {
auto: true auto: true
}, },
listGroup: [], listGroup: [],
provinceName: '', provinceName: "",
listCity: [], listCity: [],
navActive: 0, navActive: 0,
keyword: '', keyword: "",
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
type: null, type: null,
location: '', location: "",
banner: {}, banner: {},
// 推荐信息 recommendInfo: null // 推荐信息
recommendInfo: null, };
pageKeyId: ''
}
}, },
onLoad(options) { onLoad(options) {
const type = Number(options.type) this.type = Number(options.type);
this.type = type this.location = options.city;
switch(type) {
case 0:
this.pageKeyId = 'goodsIndex'
break
case 1:
this.pageKeyId = 'wenwanIndex'
break
case 3:
this.pageKeyId = 'customizedGiftIndex'
break
case 4:
this.pageKeyId = 'wellnessFoodIndex'
break
case 5:
this.pageKeyId = 'countyFamousIndex'
break
default:
this.pageKeyId = ''
break
}
this.location = options.city
if (this.location === undefined) { if (this.location === undefined) {
this.getMapData() this.getMapData();
} }
this.init() this.init();
}, },
methods: { methods: {
reload() { reload() {
@@ -251,23 +218,23 @@ export default {
}) })
}, },
async getMapData() { async getMapData() {
const map = await getLocation() const map = await getLocation();
if (map) { if (map) {
const {latitude, longitude} = map[1] const {latitude, longitude} = map[1];
const address = await getCurAddress(latitude, longitude) const address = await getCurAddress(latitude, longitude);
this.location = address[1].data.result.ad_info.city this.location = address[1].data.result.ad_info.city;
} }
}, },
init() { init() {
fetchCity(this.type).then(res => { fetchCity(this.type).then(res => {
if (res.success) { if (res.success) {
this.listGroup = res.data.group this.listGroup = res.data.group;
if (this.listGroup.length > 0) { if (this.listGroup.length > 0) {
this.listCity = this.listGroup[0].city this.listCity = this.listGroup[0].city;
this.provinceName = this.listGroup[0].label this.provinceName = this.listGroup[0].label;
this.recommendInfo = this.listGroup[0].recommendInfo this.recommendInfo = this.listGroup[0].recommendInfo
this.banner = { this.banner = {
...this.listGroup[0], ...this.listGroup[0],
icon: this.listGroup[0].icon, icon: this.listGroup[0].icon,
url: this.listGroup[0].uniappUrl url: this.listGroup[0].uniappUrl
} }
@@ -276,18 +243,18 @@ export default {
}) })
}, },
asideTap(index) { asideTap(index) {
this.navActive = index this.navActive = index;
this.listCity = this.listGroup[index].city this.listCity = this.listGroup[index].city;
this.provinceName = this.listGroup[index].label this.provinceName = this.listGroup[index].label;
this.recommendInfo = this.listGroup[index].recommendInfo this.recommendInfo = this.listGroup[index].recommendInfo
this.banner = { this.banner = {
...this.listGroup[index], ...this.listGroup[index],
icon: this.listGroup[index].icon, icon: this.listGroup[index].icon,
url: this.listGroup[index].uniappUrl url: this.listGroup[index].uniappUrl
} }
// 触发加载请求 //触发加载请求
this.mescroll.scrollTo(0, 0) this.mescroll.scrollTo(0, 0);
this.mescroll && this.mescroll.resetUpScroll(false) this.mescroll && this.mescroll.resetUpScroll(false);
}, },
emptyClick: function () { emptyClick: function () {
//触发加载请求 //触发加载请求
@@ -295,9 +262,9 @@ export default {
}, },
search() { search() {
this.listGroup.findIndex((group, index) => { this.listGroup.findIndex((group, index) => {
let result let result;
group.city.forEach(item => { group.city.forEach(item => {
result = item.cityName.indexOf(this.keyword, 0) result = item.cityName.indexOf(this.keyword, 0);
if (result !== -1) { if (result !== -1) {
this.asideTap(index); this.asideTap(index);
return null; return null;
@@ -309,8 +276,8 @@ export default {
}) })
}, },
select(item) { select(item) {
if (this.type === 0 && item.hasData === 0) return if (this.type === 0 && item.hasData === 0) return;
if ((this.type === 1 || this.type === 2) && item.hasShop === 0) return if ((this.type === 1 || this.type === 2) && item.hasShop === 0) return;
uni.setStorageSync("cityName", item.cityName) uni.setStorageSync("cityName", item.cityName)
switch (this.type) { switch (this.type) {
@@ -318,20 +285,20 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `/pkg_product/views/nativeList?cityId=${item.cityId}` url: `/pkg_product/views/nativeList?cityId=${item.cityId}`
}) })
break break;
case 1: case 1:
uni.navigateTo({ uni.navigateTo({
url: `/wenwan/views/storeList?cityId=${item.cityId}` url: `/wenwan/views/storeList?cityId=${item.cityId}`
}) })
break break;
case 6: case 6:
uni.navigateTo({ uni.navigateTo({
url: `/pkg_product/views/scenicSpot?cityId=${item.cityId}` url: `/pkg_product/views/scenicSpot?cityId=${item.cityId}`
}) })
break break;
default: default:
uni.navigateBack() uni.navigateBack()
break break;
} }
}, },
goToStore(id) { goToStore(id) {
@@ -339,41 +306,14 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: '/pagesInn/inn/innHome?id=' + id + '&from=' + this.getOptionsParams() url: "/pagesInn/inn/innHome?id=" + id
}) })
}, },
goToGoods(productId) { goToGoods(productId) {
if (!productId) { if (!productId) {
return return
} }
uni.navigateTo({ this.$global.navToGoods(productId)
url: `/pages/shop/GoodsCon/index?id=${productId}&from=${this.getOptionsParams()}`
})
},
getOptionsParams() {
// 0、特产;1、文玩;2、七彩云上;3、特色礼品;4、康养食材;5、千县名品;6、景点门票
let from = ''
switch(this.type) {
case 0:
from = 'techan'
break
case 1:
from = 'wenwan'
break
case 3:
from = 'gift'
break
case 4:
from = 'wellness'
break
case 5:
from = 'famous'
break
default:
from = ''
break
}
return from
}, },
bannerItemTapHandle(banner) { bannerItemTapHandle(banner) {
if (!banner) { if (!banner) {
+3 -3
View File
@@ -55,14 +55,14 @@ export default {
margin: 20rpx 0 0 0; margin: 20rpx 0 0 0;
.cover-box { .cover-box {
position: relative; position: relative;
width: 338rpx; width: 328rpx;
height: auto; height: auto;
border-radius: 14rpx; border-radius: 14rpx;
overflow: hidden; overflow: hidden;
} }
.cover { .cover {
width: 338rpx; width: 328rpx;
height: 338rpx; height: 328rpx;
vertical-align: middle; vertical-align: middle;
} }
.icon { .icon {
+49 -170
View File
@@ -1,30 +1,20 @@
<template> <template>
<view class="have-fun tabbar-page"> <view class="have-fun">
<view class="top-box"> <view class="top-box">
<view class="v12-justify-start v12-align-center"> <view class="search-box flex jc-between ai-center">
<view class="flex jc-end"> <input
<view class="city-box" @click="goCity('cloud')"> v-model="name"
<text style="white-space:nowrap; width: 90rpx" class="v12-primary-text one-t">{{ cityName }}</text> type="text"
<image :src="webUrl+'/orderIcon/map.png'" mode="scaleToFill"></image> placeholder="搜索店铺"
</view> placeholder-style="color:#949494"
</view> @confirm="search"
<view class="search-box v12-primary-border flex jc-between ai-center"> >
<input <image
v-model="name" class="icon"
type="text" :src="webUrl+'/20220903142935869059.png'"
placeholder="请输入关键词~" mode="scaleToFill"
placeholder-style="color:#949494" @click="search"
@confirm="search" />
>
<view class="search-btn v12-primary v12-white-text v12-radius-60" @click="search">
<text class="v12-font-bold">搜索</text>
<image
class="icon v12-ml-1"
:src="webUrl+'/orderIcon/搜索 (1).png'"
mode="scaleToFill"
/>
</view>
</view>
</view> </view>
<scroll-view class="type-box flex" scroll-x enable-flex> <scroll-view class="type-box flex" scroll-x enable-flex>
<view <view
@@ -41,39 +31,12 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="type-banner-wrap">
<view v-if="currType.titleImage" class="title">
<image
:src="currType.titleImage"
mode="heightFix"
class="img"
/>
</view>
<view v-if="currType.carousel" class="slider-wrap">
<swiper
indicatorDots="true"
indicator-color="rgba(255, 255, 255, .3)"
indicator-active-color="#ffffff"
autoplay
circular
style="height: 330rpx;"
>
<block
v-for="(item, bannerIndex) in currType.carousel"
:key="bannerIndex"
>
<swiper-item>
<view class="swiper-item" @click="typeBannerItemClick(item)">
<image :src="item.carouselImage" class="img" />
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="body"> <view class="body">
<view> <view class="flex jc-end">
<text class="v12-font-bold" v-if="currType.carousel">推荐</text> <view class="city-box" @click="goCity('cloud')">
<image :src="webUrl+'/20220903142929759087.png'" mode="scaleToFill"></image>
<text>{{ cityName }}</text>
</view>
</view> </view>
<view v-if="isLoad"> <view v-if="isLoad">
<view v-if="hotelList.length > 0"> <view v-if="hotelList.length > 0">
@@ -105,26 +68,20 @@
<view class="text">暂无数据</view> <view class="text">暂无数据</view>
</view> </view>
</view> </view>
<goo-skeleton <goo-skeleton v-else />
v-else
:show-avatar="false"
/>
</view> </view>
<xdd-tabbar :curr-index="4" />
</view> </view>
</template> </template>
<script> <script>
import { getHotelList, getHotelTypeList } from "@/api/inn.js" import { getHotelList, getHotelTypeList } from "@/api/inn.js"
import { getCurAddress, getLocation } from "@/utils/common" import { getCurAddress, getLocation } from "@/utils/common"
import GooSkeleton from '@/components/GooSkeleton/index.vue'
import FunHotelItem from './components/HotelItem' import FunHotelItem from './components/HotelItem'
import { pageListenMixins } from '@/mixins/pageListenMixins'
import XddTabbar from '@/components/xdd-tabbar'
export default { export default {
components: { components: {
FunHotelItem, GooSkeleton,
XddTabbar FunHotelItem
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -132,13 +89,9 @@ export default {
page: 1, page: 1,
typeList: [], typeList: [],
typeIndex: 0, typeIndex: 0,
// 当前选中的类型
currType: {},
cityName: '', cityName: '',
hotelList: [], hotelList: [],
isLoad: false, isLoad: false
pageKeyId: Object.freeze('findFunIndex'),
isNext: false
} }
}, },
computed: { computed: {
@@ -151,42 +104,18 @@ export default {
return arr return arr
} }
}, },
onReachBottom() {
// 后端接口结构需要调整下,需要补充总页数,前端可判断当前页数大于等于总页数则不发送网络请求
if(this.isNext) {
this.page++
this.fetchList()
}
},
onLoad() { onLoad() {
this.getMapData()
getHotelTypeList().then(({data}) => {
this.typeList = data;
})
}, },
onShow() { onShow() {
const memCityName = uni.getStorageSync('cityName') const memCityName = uni.getStorageSync('cityName')
this.page = 1
this.currType = {}
this.typeIndex = 0
this.name = ''
getHotelTypeList().then(({data}) => {
this.typeList = data
this.currType = data[this.typeIndex]
this.getMapData()
})
if (memCityName.length) { if (memCityName.length) {
this.cityName = memCityName this.cityName = memCityName
uni.removeStorageSync('cityName') uni.removeStorageSync('cityName')
this.name = '' this.search()
}
},
watch: {
cityName: {
handler(value) {
if(value) {
this.search()
}
},
immediate: true,
deep: true
} }
}, },
methods: { methods: {
@@ -197,7 +126,7 @@ export default {
}, },
goInnDetail(item) { goInnDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesInn/inn/innHome?id=${item.id}&from=fun` url: `/pagesInn/inn/innHome?id=${item.id}`
}) })
}, },
async getMapData() { async getMapData() {
@@ -205,17 +134,13 @@ export default {
if (map.length > 1) { if (map.length > 1) {
const {latitude, longitude} = map[1] const {latitude, longitude} = map[1]
const address = await getCurAddress(latitude, longitude) const address = await getCurAddress(latitude, longitude)
if(!this.cityName) { this.cityName = address[1].data.result.ad_info.city
this.cityName = address[1].data.result.ad_info.city this.search()
}
// this.search()
} }
}, },
tapType(index) { tapType(index) {
if (this.typeIndex === index) return if (this.typeIndex === index) return
this.typeIndex = index this.typeIndex = index
this.currType = this.typeList[index]
this.name = ''
this.search() this.search()
}, },
search() { search() {
@@ -248,48 +173,28 @@ export default {
data[i].videoCover = '' data[i].videoCover = ''
} }
this.hotelList.push(data[i]) this.hotelList.push(data[i])
if(data.length < 10) {
this.isNext = false
} else {
this.isNext = true
}
} }
} }
}).finally(() => { }).finally(() => {
this.isLoad = true this.isLoad = true
}) })
},
typeBannerItemClick(item) {
if (!item.hotelId) return
uni.navigateTo({ url: `/pagesInn/inn/innHome?id=${item.hotelId}` })
} }
} }
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.search-btn{
position: absolute;
top: 2rpx;
bottom: 2rpx;
right: 2rpx;
padding: 0rpx 20rpx;
display: flex;
align-items: center;
font-size: 28rpx;
}
.have-fun { .have-fun {
//padding-top: 120rpx; //padding-top: 120rpx;
.top-box { .top-box {
padding: 32rpx 0 0rpx; padding: 32rpx 0 20rpx;
background: #f5f5f5; background: #fff;
.search-box { .search-box {
position: relative; width: 686rpx;
width: 575rpx;
height: 60rpx; height: 60rpx;
box-sizing: border-box; box-sizing: border-box;
// margin: 0 auto; margin: 0 auto;
padding: 0 24rpx 0 32rpx; padding: 0 24rpx 0 32rpx;
border: 2rpx solid #BBD2D2; border: 2rpx solid #BBD2D2;
border-radius: 30rpx; border-radius: 30rpx;
@@ -305,20 +210,20 @@ export default {
} }
.type-box { .type-box {
height: 200rpx; height: 180rpx;
box-sizing: border-box; box-sizing: border-box;
white-space: nowrap; white-space: nowrap;
padding: 20rpx 20rpx 0 20rpx; padding: 20rpx 20rpx 0 48rpx;
.item { .item {
width: 154rpx; width: 160rpx;
height: 154rpx; height: 160rpx;
// margin-right: 20rpx; margin-right: 20rpx;
border-radius: 26rpx; border-radius: 26rpx;
image { image {
width: 92rpx; width: 72rpx;
height: 92rpx; height: 72rpx;
} }
.name { .name {
@@ -340,16 +245,16 @@ export default {
} }
.body { .body {
padding: 20rpx 20rpx; padding: 20rpx 32rpx;
background: #f5f5f5; background: #F9F9F9;
} }
.city-box { .city-box {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
padding: 8rpx 20rpx 8rpx 20rpx; padding: 8rpx 18rpx 8rpx 16rpx;
border-radius: 30px; border-radius: 30px;
background: #f5f5f5; background: #fff;
image { image {
width: 32rpx; width: 32rpx;
@@ -367,7 +272,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.list { .list {
width: 348rpx; width: 328rpx;
.item { .item {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
@@ -375,30 +280,4 @@ export default {
} }
} }
} }
.tabbar-page {
padding: 0 0 180rpx 0;
}
.type-banner-wrap {
padding: 0 20rpx;
background-color: #f5f5f5;
.title {
padding: 0 0 20rpx;
.img {
display: block;
height: 48rpx;
}
}
.slider-wrap {
width: 100%;
height: 330rpx;
padding: 0 0 20rpx 0;
.swiper-item {
.img {
display: block;
width: 100%;
height: 330rpx;
}
}
}
}
</style> </style>
-70
View File
@@ -1,70 +0,0 @@
<template>
<view>
<view class="culture v12-d-grid-columns-2">
<view class="img-item " v-for="(item, index) in list" :key="index">
<image class="img-item" :src="item" mode="widthFix|heightFix" lazy-load="false"></image>
</view>
</view>
<image
v-if="list.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
<script>
import {
getCulture,
} from "@/api/product"
export default {
props: {
landmarkDataId: null
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
list: []
}
},
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
}
},
mounted() {
this.getData()
},
methods: {
getData() {
getCulture({landmarkDataId: this.landmarkDataId}).then(res => {
this.list = res.data.cultureImages
})
}
}
}
</script>
<style lang="scss" scoped>
.culture{
grid-gap: 20rpx 20rpx;
padding: 20rpx;
}
.img-item{
width: 340rpx;
height: 320rpx;
border-radius: 16rpx;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>
-133
View File
@@ -1,133 +0,0 @@
<template>
<view class="list-box flex flex-wrap">
<view
v-for="item in goods"
:key="item.id"
class="item"
@click="goGoods(item.productId)"
>
<image
:src="webUrl + '/home/mark-land.png'"
class="mark-img"
/>
<image
:src="item.storeImage"
mode="scaleToFill"
class="good-img"
/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="one-t desc">{{ item.description }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image
:src="webUrl + '/home/icon-cart.png'"
class="btn"
/>
</view>
</view>
</view>
<image
v-if="goods.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
<script>
export default {
props: {
goods: {
default: () => []
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
}
},
methods: {
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
})
}
}
}
</script>
<style lang="scss" scoped>
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
.list-box {
margin-top: 24rpx;
.item {
position: relative;
width: 344rpx;
margin-right: 22rpx;
margin-bottom: 22rpx;
border-radius: 20rpx;
background: #FFFFFF;
overflow: hidden;
.mark-img {
position: absolute;
top: 0;
right: 0;
z-index: 3;
display: block;
width: 84rpx;
height: 74rpx;
}
.good-img {
display: block;
width: 344rpx;
height: 344rpx;
}
.content {
height: 156rpx;
padding: 8rpx 8rpx 18rpx 8rpx;
.more-t {
font-size: 28rpx;
line-height: 36rpx;
color: #333;
}
.desc {
padding: 5rpx 0;
height: 34rpx;
color: #FFC543;
font-size: 24rpx;
}
.price {
font-size: 40rpx;
line-height: 40rpx;
font-weight: bold;
color: #C52733;
}
.btn {
display: block;
width: 48rpx;
height: 48rpx;
}
}
}
.item:nth-child(2n) {
margin-right: 0;
}
}
.list-wrap {
margin: 20rpx 0 0 0;
padding: 0 20rpx;
.loadend {
width: 100%;
}
}
</style>
-287
View File
@@ -1,287 +0,0 @@
<template>
<view>
<view v-if="infoArray.length > 0" class="info-wrapper">
<view class="info-list">
<view v-for="(item, index) in infoArray" :key="index" class="info-item">
<view
:class="item.isTop === 1 ? 'info-item-top' : ''"
:style="{
'background-image': item.isTop
? 'url(' + webUrl + '/page/hotel/info-top-bg.png)'
: 'none',
}"
class="info-item-header"
>
<view class="name">
{{ item.title }}
</view>
<view class="intro">
{{ item.content }}
</view>
</view>
<view class="info-item-body">
<img-box
:imgList="item.images"
:num="item.images.length"
:img-radius="10"
style="width: 100%"
@click="infoItemViewClick(item)"
/>
</view>
<view class="info-item-bottom">
<view class="time">
{{
item.createTime
? item.createTime.replace(/-/g, ".").substr(0, 10)
: ""
}}
</view>
<view class="btns">
<view class="flex">
<image
:src="webUrl + '/20230803152147141807.png'"
class="icon"
/>
<text class="seeNum-txt v12-font-28">{{ item.pv }}</text>
</view>
<view class="flex">
<image
v-if="!item.hasZan"
:src="webUrl + '/page/hotel/zan-off-2.png'"
class="zan-off-icon"
@click="likeInfoItemHandle(item, index, item.zan + 1, true)"
/>
<image
v-else
:src="webUrl + '/page/hotel/zan-on-2.png'"
class="zan-on-icon"
@click="likeInfoItemHandle(item, index, item.zan - 1, false)"
/>
<text
v-show="item.zan > 0"
:class="item.hasZan ? 'on' : ''"
class="seeNum-txt v12-font-28 v12-ml-1"
>{{ item.zan }}</text
>
</view>
</view>
</view>
</view>
</view>
<image
:src="webUrl + '/home/no-data-bg.png'"
mode="widthFix"
class="no-data-loadend"
/>
</view>
<image
v-if="infoArray.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
<script>
import {
getNews,
hadLike,
hadView
} from "@/api/product"
import imgBox from '@/components/imageTypeSet/imagebox.vue'
export default {
props: {
landmarkDataId: null
},
components: {
imgBox
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
infoArray: []
}
},
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
}
},
created() {
this.getData()
},
methods: {
getData() {
const params = {
landmarkDataId: this.landmarkDataId,
page: 1,
limit: 9999
}
getNews(params).then(res => {
this.infoArray = res.data.records
})
},
likeInfoItemHandle(item, index, value, voValue) {
hadLike({ landmarkNewsId: item.id }).then(res => {
const { success } = res
if (success) {
this.$dialog.toast({
mes: '操作成功!'
})
this.$set(this.infoArray[index], 'zan', value)
this.$set(this.infoArray[index], 'hasZan', voValue)
}
})
},
infoItemViewClick(item) {
uni.$u.debounce(() => {
hadView({ landmarkNewsId: item.id }).finally(() => {
this.infoArray.map(info => {
if (info.id === item.id) {
info.pv += 1
}
})
})
}, 500)
},
}
};
</script>
<style lang="scss" scoped>
.info-item + .info-item {
margin: 22rpx 0 0 0;
}
.info-item {
border-radius: 10rpx;
background-color: #fff;
.info-item-header {
position: relative;
padding: 20rpx 20rpx 0 20rpx;
&.info-item-top {
padding-top: 60rpx;
background-size: 100% 80rpx;
background-repeat: no-repeat;
background-image: url();
}
.name {
font-size: 16px;
color: #333;
font-weight: bold;
}
.intro {
margin: 10rpx 0 0 0;
color: #666;
font-size: 14px;
}
}
.info-item-body {
padding: 0 20rpx 20rpx 20rpx;
.video {
padding: 20rpx 0 0 0;
.video-item {
width: 100%;
height: 400rpx;
border-radius: 10rpx;
}
}
}
.info-item-bottom {
display: flex;
align-items: center;
padding: 20rpx;
border-top: 1px solid #f1f1f1;
font-size: 16px;
.time {
flex: 1;
color: #999999;
font-size: 28rpx;
}
.btns {
display: flex;
color: #999;
.flex + .flex {
margin: 0 0 0 32rpx;
}
.flex {
align-items: center;
}
.icon {
width: 32rpx;
height: 32rpx;
margin: 0 8rpx 0 0;
}
.zan-off-icon {
width: 32rpx;
height: 32rpx;
}
.zan-on-icon {
width: 32rpx;
height: 32rpx;
}
.seeNum-txt {
&.on {
color: #D81E06;
}
}
.more-btn {
position: relative;
.more-wrapper {
position: absolute;
right: -20rpx;
top: -150rpx;
z-index: 5;
width: 200rpx;
border-radius: 12rpx;
background-color: #fff;
box-shadow: 0px 1px 6px rgba(0,0,0,0.16);
.more-item + .more-item {
border-top: 1px solid #d5d5d5;
}
.more-item {
display: flex;
align-items: center;
justify-content: center;
height: 70rpx;
font-size: 14px;
color: #333;
.more-icon {
width: 36rpx;
height: 36rpx;
margin: 0 10rpx 0 0;
}
}
}
}
}
}
}
.info-item-top {
padding-top: 60rpx;
background-size: 100% 80rpx;
background-repeat: no-repeat;
background-image: url();
}
.name {
font-size: 16px;
color: #333;
font-weight: bold;
}
.intro {
margin: 10rpx 0 0 0;
color: #666;
font-size: 14px;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>
-160
View File
@@ -1,160 +0,0 @@
<template>
<view class="policy">
<view class="list-item" v-for="(item, index) in currentList" :key="index" @click="fileItemClick(item)">
<view class="v12-justify-start v12-align-center">
<view class="v12-font-bold v12-font-28">·</view>
<view class="item-title one-t">{{ item.title }}</view>
</view>
<view class="item-action v12-dark"><u-icon name="arrow-right" color="#fff" size="8"></u-icon></view>
</view>
<view class="more-wrap" v-if="isMore ? isMore : list.length > 3">
<view class="more-btn v12-primary v12-align-center" @click="showMore">
{{ isMore ? '收起' : '查看更多' }}
<view class="item-action v12-white"><u-icon name="arrow-right" color="#C52733 " size="12"></u-icon></view>
</view>
</view>
<image
v-if="list.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
<script>
import {
getPorjectPolicyFiles,
} from "@/api/product"
export default {
props: {
landmarkDataId: null
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
list: [],
currentList: [],
isMore: false
}
},
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
}
},
mounted() {
this.getData()
},
methods: {
getData() {
const params = {
landmarkDataId: this.landmarkDataId,
page: 1,
limit: 99999
}
getPorjectPolicyFiles(params).then(res => {
this.list = res.data.records
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
}
})
},
showMore() {
this.isMore = !this.isMore
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
}
},
fileItemClick(file) {
const url = file.attachment || ''
if (!url) return
uni.downloadFile({
url,
success: res => {
const filePath = res.tempFilePath
wx.openDocument({
filePath,
fail: (err) => {
console.log(err)
}
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
.more-btn{
.item-action{
width: 20rpx;
height: 20rpx;
margin-left: 10rpx;
}
}
.policy{
padding: 20rpx;
background: #f0f0f0;
border-radius: 24rpx;
}
.list-item{
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 20rpx;
border-radius: 24rpx;
align-items: center;
padding: 10rpx 20rpx;
}
.item-action{
font-size: 22rpx;
width: 24rpx;
height: 24rpx;
color: #fff;
padding: 5rpx;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
line-height: 24rpx;
}
.item-title{
font-size: 24rpx;
color: #333;
margin-left: 10rpx;
}
.log-img{
width: 68rpx;
height: 68rpx;
background: rgba(197,39,51,0.39);
border-radius: 50%;
}
.more-wrap{
display: flex;
align-content: center;
justify-content: center;
}
.more-btn{
color: #fff;
font-size: 28rpx;
padding: 5rpx 20rpx;
border-radius: 30rpx;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>
-133
View File
@@ -1,133 +0,0 @@
<template>
<view class="projects">
<view class="tabs-wrap">
<view
@click="handleTab(item.value)"
class="tab-item"
:class="{
'tab-isActived': actived === item.value
}"
v-for="(item, index) in tabs"
:key="index">
<view
:class="{
'tab-isActived': actived === item.value,
'no-actived-1': actived === 2 && item.value === 1,
'no-actived-2': actived === 1 && item.value === 2,
'no-actived-3': actived === 3 && item.value === 2,
'no-actived-4': actived === 2 && item.value === 3,
}"
>{{ item.name }}</view>
</view>
</view>
<view
class="content"
:class="{
'first-one': actived === 1,
'last-one': actived === 3
}"
>
<recommend v-if="actived === 1" :landmarkDataId="landmarkDataId"></recommend>
<policy v-if="actived === 2" :landmarkDataId="landmarkDataId"></policy>
<serviec v-if="actived === 3" :info="info"></serviec>
</view>
</view>
</template>
<script>
import recommend from './recommend.vue'
import policy from './policy.vue'
import serviec from './serviec.vue'
export default {
components: {
recommend,
policy,
serviec
},
props: {
landmarkDataId: null,
info: {
default:() => {}
}
},
data() {
return {
actived: 1,
tabs: [
{name: '企业推荐', value: 1},
{name: '政策', value: 2},
{name: '服务', value: 3},
]
}
},
methods: {
handleTab(value) {
this.actived = value
}
}
}
</script>
<style lang="scss" scoped>
.fit-box-inner{
background: #f0f0f0;
width: initial;
height: inherit;
width: 40rpx;
}
.first-one{
border-radius: 0 24rpx 24rpx 24rpx !important;
}
.last-one{
border-radius: 24rpx 0 24rpx 24rpx !important;
}
.fit-box{
width: 40rpx;
height: initial;
background: #fff;
display: flex;
}
.projects{
padding: 20rpx;
}
.tabs-wrap{
display: flex;
justify-content: space-between;
}
.tab-item{
text-align: center;
flex: 1;
font-size: 32rpx;
font-weight: bold;
background: #fff;
view{
padding: 20rpx 0;
background: #f0f0f0;
width: inherit;
height: inherit;
}
}
.no-actived-1{
border-radius: 0 0 24rpx 0 !important;
}
.no-actived-2{
border-radius: 0 0 0 24rpx !important;
}
.no-actived-3{
border-radius: 0 0 24rpx 0 !important;
}
.no-actived-4{
border-radius: 0 0 0 24rpx !important;
}
.tab-isActived{
background: #fff !important;
border-radius: 24rpx 24rpx 0 0 !important;
position: relative;
}
.content{
background: #fff;
padding: 20rpx 10rpx;
border-radius: 24rpx;
}
</style>
-161
View File
@@ -1,161 +0,0 @@
<template>
<view class="recommend">
<view class="list-item" v-for="(item, index) in currentList" :key="index" @click="toStore(item.hotelId)">
<view class="v12-justify-start v12-align-center">
<view class="log-img">
<image class="log-img" :src="item.logo" mode="aspectFit|aspectFill|widthFix"></image>
</view>
<view class="item-title one-t">{{ item.name }}</view>
</view>
<view class="item-action-wrap v12-primary">
点击查看
<view class="item-action v12-white"><u-icon name="arrow-right" color="#C52733" size="8"></u-icon></view>
</view>
</view>
<view class="more-wrap" v-if="isMore ? isMore : list.length > 3">
<view class="more-btn v12-primary" @click="showMore">
{{ isMore ? '收起' : '查看更多' }}
<view class="item-action v12-white"><u-icon name="arrow-right" color="#C52733 " size="12"></u-icon></view>
</view>
</view>
<image
v-if="list.length === 0"
:src="webUrl + '/20231023131208675588.png'"
class="img-nodata"
mode="scaleToFill"
/>
</view>
</template>
<script>
import {
getPorjectRecommend,
} from "@/api/product"
export default {
props: {
landmarkDataId: null
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
list: [],
currentList: [],
isMore: false
}
},
watch: {
landmarkDataId(value) {
if(value) {
this.getData()
}
}
},
mounted() {
this.getData()
},
methods: {
getData() {
getPorjectRecommend({landmarkDataId: this.landmarkDataId}).then(res => {
this.list = res.data
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
}
})
},
toStore(id) {
if (!id) {
return
}
uni.navigateTo({
url: '/pagesInn/inn/innHome?id=' + id
})
},
showMore() {
this.isMore = !this.isMore
if(this.isMore) {
this.currentList = this.list
} else {
this.currentList = this.list.filter((item, index) => index < 3)
}
}
}
}
</script>
<style lang="scss" scoped>
.more-btn{
display: flex;
align-items: center;
justify-content: center;
.item-action{
width: 20rpx;
height: 20rpx;
margin-left: 10rpx;
padding: 5rpx;
}
}
.recommend{
padding: 20rpx;
background: #f0f0f0;
border-radius: 24rpx;
}
.list-item{
display: flex;
justify-content: space-between;
background: #fff;
margin-bottom: 20rpx;
border-radius: 24rpx;
align-items: center;
padding: 10rpx 20rpx;
}
.item-action-wrap{
font-size: 22rpx;
display: flex;
align-items: center;
border-radius: 30rpx;
color: #fff;
padding: 5rpx 10rpx;
}
.item-action{
width: 20rpx;
height: 20rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
margin-left: 10rpx;
}
.item-title{
font-size: 26rpx;
color: #333;
margin-left: 20rpx;
}
.log-img{
width: 68rpx;
height: 68rpx;
border-radius: 50%;
}
.more-wrap{
display: flex;
align-content: center;
justify-content: center;
}
.more-btn{
color: #fff;
font-size: 28rpx;
padding: 5rpx 20rpx;
border-radius: 30rpx;
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
</style>
-100
View File
@@ -1,100 +0,0 @@
<template>
<view class="service">
<view class="map-cont">
<map
:longitude="info.longitude"
:latitude="info.latitude"
style="width: 100%;height: 400rpx; border-radius: 20rpx;"
/>
</view>
<view class="v12-mt-3 info-wrap">
<view>
<view class="v12-font-32 v12-font-bold v12-mb-2">{{ info.name }}</view>
<view class="v12-font-24 v12-mb-1 v12-dark1-text">办公时间:{{ info.officeTime }}</view>
<view class="v12-font-24 v12-mb-1 v12-dark1-text">{{ info.address }}</view>
</view>
<view class="action-wrap">
<view>
<view>
<image :src="webUrl + '/page/qianxian/icon-addr.png'" class="img" />
</view>
<view class="text-center">导航</view>
</view>
<view>
<view>
<image :src="webUrl + '/page/qianxian/icon-phone.png'" class="img" />
</view>
<view class="text-center">客服</view>
</view>
</view>
</view>
<view style="padding: 0 20rpx;"><u-divider></u-divider></view>
<view class="intro-wrap">
<view class="v12-dark-text v12-font-bold">
简介
</view>
<view class="intro-text">
{{ info.intro }}
</view>
</view>
</view>
</template>
<script>
export default {
props: {
info: {
default: () => {}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
}
},
mounted() {
console.log(this.info);
},
}
</script>
<style lang="scss" scoped>
.intro-text{
color: #999;
font-size: 24rpx;
margin-top: 20rpx;
}
.intro-wrap{
padding: 0 20rpx 20rpx;
}
.action-wrap{
display: flex;
align-items: center;
.text-center{
text-align: center;
font-size: 24rpx;
color: #666;
}
}
.info-wrap{
display: flex;
justify-content: space-around;
padding: 40rpx 0 0;
}
.service{
position: relative;
}
.map-cont {
height: 400rpx;
border-radius: 20rpx;
background: #f2f1ed;
padding: 20rpx;
box-sizing: border-box;
}
.img{
display: block;
width: 64rpx;
height: 64rpx;
margin: 0 0 16rpx 16rpx;
}
</style>
+989 -661
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+368 -201
View File
@@ -1,262 +1,429 @@
<template>
<view class="pkg-product-land-mark">
<view v-if="isLoad">
<view class="top-wrap">
<view class="top-box">
<view class="nav flex">
<view
v-for="(item,index) in navList"
:key="index"
:class="{
'active': navIndex === index
}"
class="flex flex-0 ai-center nav-item"
@click="changeNav(index)"
>
<image
:src="webUrl + '/home/landmark-icon.png'"
class="bg"
/>
{{ item.provinceName }}
</view>
</view>
<view class="view-box">
<view class="map-box">
<image
:src="mapData.mapImage"
mode="widthFix"
class="img-map"
/>
</view>
</view>
</view>
</view>
<view
class="middle-img-wrap"
>
<image
v-if="mapData.middleImage"
:src="mapData.middleImage"
mode="widthFix"
class="img"
/>
<view class="tabs-wrap">
<view @click="handleTab(item.value)" :class="{ 'tab-actived' : item.value === actived }" class="tab-item" v-for="(item, index) in tabs" :key="index">{{ item.name }}</view>
</view>
</view>
<view class="list-wrap">
<view v-if="actived === 1">
<projects :landmarkDataId="landmarkDataId" :info="mapData.serviceInfo"></projects>
</view>
<view v-if="actived === 2">
<culture :landmarkDataId="landmarkDataId"></culture>
</view>
<view v-if="actived === 3">
<information :landmarkDataId="landmarkDataId"></information>
</view>
<view v-if="actived === 4">
<goods :goods="goods" v-if="goods.length > 0"></goods>
<image
v-if="isCompleteLoadGood"
:src="webUrl + '/home/no-data-bg.png'"
mode="widthFix"
class="loadend"
/>
</view>
</view>
</view>
<goo-skeleton
v-else
:show-avatar="false"
/>
</view>
</template>
<script> <script>
import { import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
getProvince,
getProvinceGoods,
getProvinceList
} from "@/api/product"
import goods from "./components/goods.vue"
import { pageListenMixins } from '@/mixins/pageListenMixins'
import projects from './components/projects.vue'
import culture from "./components/culture.vue"
import information from "./components/information.vue"
export default { export default {
name: 'LandMarkPage', name: "landMark",
components: {
goods,
projects,
culture,
information
},
mixins: [pageListenMixins],
data() { data() {
return { return {
actived: 1,
tabs: [
{name: '项目', value: 1},
{name: '文化', value: 2},
{name: '资讯', value: 3},
{name: '产品', value: 4},
],
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: '', keyword: '',
isLoad: false,
page: 1, page: 1,
navList: [], navList: [],
navIndex: 0, navIndex: 0,
mapData: null, mapData: null,
mapLocations: [],
goods: [], goods: [],
isCompleteLoadGood: false, directionClass: ['', 'up', 'right', 'down', 'left'],
pageKeyId: Object.freeze('landmarkGoodsIndex')
} }
}, },
computed: { computed: {
landmarkDataId() { topBoxBgColor() {
return this.navList[this.navIndex] ? this.navList[this.navIndex]['id'] : null return this.navList.length > 0 ? this.navList[this.navIndex]['backgroundColor'] : '#FFFFFF';
},
viewBoxBgColor() {
return this.mapData?.backgroundColor || '#FFFFFF';
},
scale() {
return 718 / (this.mapData?.mapImageWidth || 1);
} }
}, },
onLoad() { onLoad() {
this.getNavList() this.getNavList();
},
onHide() {
this.pageToHideHandle()
}, },
onReachBottom() { onReachBottom() {
if (this.isCompleteLoadGood) { this.page++;
return this.fetchGoods();
}
this.page++
this.fetchGoods()
}, },
methods: { methods: {
handleTab(value) {
this.actived = value
},
getNavList() { getNavList() {
getProvinceList().then(({data}) => { getProvinceList().then(({data}) => {
this.navList = data this.navList = data;
this.changeNav(this.navIndex) this.changeNav(this.navIndex);
}) });
}, },
search() {
this.page = 1;
this.fetchGoods();
},
changeNav(index) { changeNav(index) {
this.navIndex = index this.navIndex = index;
this.page = 1 this.page = 1;
this.goods = [] this.getMap();
this.isCompleteLoadGood = false this.fetchGoods();
this.actived = 1
this.getMap()
this.fetchGoods()
}, },
getMap() { getMap() {
const id = this.navList[this.navIndex]['id'] const id = this.navList[this.navIndex]['id']
getProvince(id).then(({data}) => { getProvince(id).then(({data}) => {
this.mapData = data || {} this.mapData = data;
this.isLoad = true this.mapLocations = data.mapLocations;
this.calcPosition();
});
},
// 计算位置
calcPosition() {
this.mapLocations?.forEach(item => {
item.gx = item.x * this.scale;
item.gy = item.y * this.scale;
}) })
}, },
fetchGoods() { fetchGoods() {
const id = this.navList[this.navIndex]['id'] const id = this.navList[this.navIndex]['id']
getProvinceGoods(id, this.keyword, this.page).then(({data}) => { getProvinceGoods(id, this.keyword, this.page).then(({data}) => {
const len = data.length if (this.page === 1) this.goods = [];
for (let i = 0; i < len; i++) { for (let i = 0; i < data.length; i++) {
this.goods.push(data[i]) this.goods.push(data[i]);
} }
if (len === 0 || len < 10) {
this.isCompleteLoadGood = true
}
})
},
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
}) })
} }
} }
} }
</script> </script>
<style scoped lang="less"> <template>
.tabs-wrap{ <view class="pkg-product-land-mark" v-if="mapData">
display: flex; <view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
justify-content: space-around; <view class="view-box">
padding: 20rpx 20rpx 0; <view class="search-box flex ai-center">
color: #333; <input
font-weight: bold; v-model="keyword"
font-size: 36rpx; type="text"
} placeholder="搜索商品"
.tab-item{ placeholder-style="color:#999"
@confirm="search()"
/>
<image
:src="webUrl+'/20231223183627184005.png'"
mode="scaleToFill"
style="width:30rpx;height:30rpx"
@click="search()"
/>
</view>
} <view class="map-box">
.tab-actived{ <image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
color: #fff;
font-weight: bold; <view class="item" :style="{'left':item.gx+'rpx','top':item.gy+'rpx'}" v-for="item in mapLocations" @click="$global.navToGoods(item.productId)">
background: linear-gradient(to right, #C52733 0%, rgba(211,92,101,0.91) 54%, rgba(255,255,255,0.62) 100%); <view class="round">
border-radius: 38rpx 0rpx 0 38rpx; <view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
padding: 0 20rpx; </view>
} <view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
.top-wrap{ <image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
padding: 20rpx 20rpx 0; <view class="title flex ai-center">{{ item.mapTitle }}</view>
} <image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
</view>
</view>
</view>
</view>
<view class="nav flex">
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
:key="index" @click="changeNav(index)">{{ item.provinceName }}
</view>
</view>
</view>
<view class="main-box" v-if="mapData.recommended.storeImage"
@click="$global.navToGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view>
<view class="more-t">{{ mapData.recommended.description }}</view>
</view>
</view>
<view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="$global.navToGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
</view>
</view>
</view>
</view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
v-if="goods.length===0"/>
</view>
</template>
<style scoped lang="less">
.pkg-product-land-mark { .pkg-product-land-mark {
background: #f0f0f0; background: #F7F3ED;
image {
vertical-align: middle;
}
.top-box { .top-box {
border-radius: 20rpx; padding: 32rpx 0 20rpx;
background-color: #fff;
.view-box { .view-box {
position: relative; position: relative;
padding: 20rpx; margin: 0 16rpx;
border-radius: 20rpx; border-radius: 40rpx;
overflow: hidden; overflow: hidden;
.img-map {
display: block; .search-box {
width: 100%; position: absolute;
} top: 20rpx;
} left: 34rpx;
.nav { width: 650rpx;
padding: 20rpx 20rpx 0 20rpx; height: 64rpx;
overflow-x: scroll; padding: 0 32rpx;
.nav-item + .nav-item {
margin: 0 0 0 20rpx;
}
.nav-item {
position: relative;
box-sizing: border-box; box-sizing: border-box;
padding: 0 32rpx 20rpx 0; border-radius: 32rpx;
color: #333; background: #FFFFFF;
font-size: 32rpx; z-index: 10;
.bg {
display: none; input {
width: 100%;
height: 100%;
line-height: 64rpx;
font-size: 28rpx;
}
}
.map-box {
position: relative;
width: 718rpx;
.img-map {
width: 718rpx;
height: auto;
}
.item {
position: absolute; position: absolute;
bottom: 0;
right: 6rpx; .round {
width: 63rpx; width: 8rpx;
height: 42rpx; height: 8rpx;
border-radius: 50%;
box-shadow: 0 0 0 8rpx rgba(225, 38, 65, .4);;
background: #E12641;
}
.line {
position: relative;
border: 2rpx solid #E12641;
}
.line-up {
left: 50%;
transform: translate(-50%, -100%);
width: 0;
height: 30rpx;
}
.line-right {
top: 50%;
transform: translate(0, -50%);
width: 30rpx;
height: 0;
}
.line-down {
left: 50%;
transform: translate(-50%, 0);
width: 0;
height: 30rpx;
}
.line-left {
top: 50%;
transform: translate(-100%, -50%);
width: 30rpx;
height: 0;
}
.label {
position: relative;
.cover {
width: 60rpx;
height: 60rpx;
box-sizing: border-box;
border: 6rpx solid #E12641;
border-radius: 50%;
z-index: 20;
}
.title {
height: 32rpx;
box-sizing: border-box;
margin-bottom: 10rpx;
padding: 0 16rpx;
background: #E12641;
color: #FFFFFF;
font-size: 22rpx;
line-height: 32rpx;
white-space: nowrap;
z-index: 10;
}
}
.label-up {
top: -80rpx;
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-right {
top: -40rpx;
left: 32rpx;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-down {
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-left {
left: -100%;
transform: translate(-30rpx, -40rpx);
.title {
margin-left: -9rpx;
border-radius: 0 20rpx 20rpx 0;
}
}
} }
} }
}
.nav {
padding: 30rpx 20rpx 0;
overflow-x: scroll;
view {
height: 52rpx;
box-sizing: border-box;
padding: 0 18rpx;
border: 4rpx solid transparent;
color: #FFFFFF;
font-size: 32rpx;
}
.active { .active {
font-size: 40rpx; border-color: #FFFFFF;
font-weight: bold; border-radius: 26rpx;
.bg {
display: block;
}
} }
} }
} }
.middle-img-wrap {
margin: 20rpx 0 0 0; .main-box {
background: #fff; position: relative;
padding: 20rpx; width: 718rpx;
.img { height: 360rpx;
display: block; margin: 24rpx 16rpx;
border-radius: 16rpx;
overflow: hidden;
.bg-main {
width: 718rpx;
height: 360rpx;
}
.box-mask {
position: absolute;
left: 0;
bottom: 0;
width: 100%; width: 100%;
border-radius: 20rpx; height: 200rpx;
box-sizing: border-box;
padding: 20rpx 16rpx 16rpx;
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
color: #FFFFFF;
.one-t {
margin-bottom: 16rpx;
font-size: 46rpx;
line-height: 52rpx;
}
.more-t {
width: 100%;
box-sizing: border-box;
padding-top: 10rpx;
border-top: 1rpx solid #FFFFFF;
font-size: 28rpx;
line-height: 32rpx;
}
} }
} }
.list-box {
margin-top: 24rpx;
padding: 0 16rpx 34rpx;
.item {
width: 234rpx;
height: 380rpx;
margin-right: 8rpx;
margin-bottom: 24rpx;
border-radius: 12rpx;
background: #FFFFFF;
overflow: hidden;
image {
width: 234rpx;
height: 234rpx;
}
.content {
height: 122rpx;
margin: 6rpx 6rpx 18rpx;
.more-t {
font-size: 28rpx;
line-height: 36rpx;
color: #333333;
}
.price {
font-size: 28rpx;
line-height: 36rpx;
color: #DC1616;
}
.btn {
width: 118rpx;
height: 42rpx;
//background: linear-gradient(180deg, #EFEDC7 0%, #EAC94B 100%);
//border-radius: 4rpx;
//color: #764A00;
//font-size: 24rpx;
}
}
}
.item:nth-child(3n) {
margin-right: 0;
}
}
.img-nodata { .img-nodata {
position: relative; position: relative;
top: 0; top: 0;
-454
View File
@@ -1,454 +0,0 @@
<template>
<view class="pkg-product-land-mark" v-if="mapData">
<view class="top-box" :style="{'backgroundColor':topBoxBgColor}">
<view class="view-box">
<view class="search-box flex ai-center">
<input
v-model="keyword"
type="text"
placeholder="搜索商品"
placeholder-style="color:#999"
@confirm="search()"
/>
<image
:src="webUrl+'/20231223183627184005.png'"
mode="scaleToFill"
style="width:30rpx;height:30rpx"
@click="search()"
/>
</view>
<view class="map-box">
<image class="img-map" :src="mapData.mapImage" mode="widthFix"/>
<view
v-for="(item, index) in mapLocations"
:key="index"
class="item"
:style="{'left':item.gx+'rpx','top':item.gy+'rpx'}"
@click="goGoods(item.productId)"
>
<view class="round">
<view class="line" :class="'line-'+directionClass[item.labelDirection]"></view>
</view>
<view class="label flex ai-end" :class="'label-'+directionClass[item.labelDirection]">
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection===4"/>
<view class="title flex ai-center">{{ item.mapTitle }}</view>
<image class="cover flex-0" :src="item.mapImage" mode="scaleToFill" v-if="item.labelDirection!==4"/>
</view>
</view>
</view>
</view>
<view class="nav flex">
<view class="flex flex-0 ai-center" :class="{'active': navIndex===index}" v-for="(item,index) in navList"
:key="index" @click="changeNav(index)">{{ item.provinceName }}
</view>
</view>
</view>
<view class="main-box" v-if="mapData.recommended.storeImage"
@click="goGoods(mapData.recommended.productId)">
<image class="bg-main" :src="mapData.recommended.storeImage" mode="scaleToFill"/>
<view class="box-mask flex flex-col jc-end">
<view class="one-t bold">{{ mapData.recommended.title }}</view>
<view class="more-t">{{ mapData.recommended.description }}</view>
</view>
</view>
<view class="list-box flex flex-wrap">
<view class="item" v-for="item in goods" :key="item.id" @click="goGoods(item.productId)">
<image :src="item.storeImage" mode="scaleToFill"/>
<view class="content flex flex-col jc-between">
<view class="more-t bold">{{ item.title }}</view>
<view class="flex jc-between ai-center">
<text class="price">{{ item.price }}</text>
<image class="btn" :src="webUrl+'/20231114151028082368.png'" mode="scaleToFill"/>
<!-- <view class="btn flex jc-center ai-center">立即购买</view>-->
</view>
</view>
</view>
</view>
<image class="img-nodata" :src="webUrl+'/20231023131208675588.png'" mode="scaleToFill"
v-if="goods.length===0"/>
</view>
</template>
<script>
import {getProvince, getProvinceGoods, getProvinceList} from "@/api/product";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: 'LandMarkPage',
mixins: [pageListenMixins],
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
keyword: '',
page: 1,
navList: [],
navIndex: 0,
mapData: null,
mapLocations: [],
goods: [],
directionClass: ['', 'up', 'right', 'down', 'left'],
pageKeyId: Object.freeze('landmarkGoodsIndex')
}
},
computed: {
topBoxBgColor() {
return this.navList.length > 0 ? this.navList[this.navIndex]['backgroundColor'] : '#FFFFFF';
},
viewBoxBgColor() {
return this.mapData?.backgroundColor || '#FFFFFF';
},
scale() {
return 718 / (this.mapData?.mapImageWidth || 1);
}
},
onLoad() {
this.getNavList();
},
onHide() {
this.pageToHideHandle()
},
onReachBottom() {
this.page++;
this.fetchGoods();
},
methods: {
getNavList() {
getProvinceList().then(({data}) => {
this.navList = data;
this.changeNav(this.navIndex);
});
},
search() {
this.page = 1;
this.fetchGoods();
},
changeNav(index) {
this.navIndex = index;
this.page = 1;
this.getMap();
this.fetchGoods();
},
getMap() {
const id = this.navList[this.navIndex]['id']
getProvince(id).then(({data}) => {
this.mapData = data;
this.mapLocations = data.mapLocations;
this.calcPosition();
});
},
// 计算位置
calcPosition() {
this.mapLocations?.forEach(item => {
item.gx = item.x * this.scale;
item.gy = item.y * this.scale;
})
},
fetchGoods() {
const id = this.navList[this.navIndex]['id']
getProvinceGoods(id, this.keyword, this.page).then(({data}) => {
if (this.page === 1) this.goods = [];
for (let i = 0; i < data.length; i++) {
this.goods.push(data[i]);
}
})
},
goGoods(id) {
uni.navigateTo({
url: `/pages/shop/GoodsCon/index?id=${id}&from=landmark`
})
}
}
}
</script>
<style scoped lang="less">
.pkg-product-land-mark {
background: #F7F3ED;
image {
vertical-align: middle;
}
.top-box {
padding: 32rpx 0 20rpx;
.view-box {
position: relative;
margin: 0 16rpx;
border-radius: 40rpx;
overflow: hidden;
.search-box {
position: absolute;
top: 20rpx;
left: 34rpx;
width: 650rpx;
height: 64rpx;
padding: 0 32rpx;
box-sizing: border-box;
border-radius: 32rpx;
background: #FFFFFF;
z-index: 10;
input {
width: 100%;
height: 100%;
line-height: 64rpx;
font-size: 28rpx;
}
}
.map-box {
position: relative;
width: 718rpx;
.img-map {
width: 718rpx;
height: auto;
}
.item {
position: absolute;
.round {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
box-shadow: 0 0 0 8rpx rgba(225, 38, 65, .4);;
background: #E12641;
}
.line {
position: relative;
border: 2rpx solid #E12641;
}
.line-up {
left: 50%;
transform: translate(-50%, -100%);
width: 0;
height: 30rpx;
}
.line-right {
top: 50%;
transform: translate(0, -50%);
width: 30rpx;
height: 0;
}
.line-down {
left: 50%;
transform: translate(-50%, 0);
width: 0;
height: 30rpx;
}
.line-left {
top: 50%;
transform: translate(-100%, -50%);
width: 30rpx;
height: 0;
}
.label {
position: relative;
.cover {
width: 60rpx;
height: 60rpx;
box-sizing: border-box;
border: 6rpx solid #E12641;
border-radius: 50%;
z-index: 20;
}
.title {
height: 32rpx;
box-sizing: border-box;
margin-bottom: 10rpx;
padding: 0 16rpx;
background: #E12641;
color: #FFFFFF;
font-size: 22rpx;
line-height: 32rpx;
white-space: nowrap;
z-index: 10;
}
}
.label-up {
top: -80rpx;
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-right {
top: -40rpx;
left: 32rpx;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-down {
left: -50%;
.title {
margin-right: -9rpx;
border-radius: 20rpx 0 0 20rpx;
}
}
.label-left {
left: -100%;
transform: translate(-30rpx, -40rpx);
.title {
margin-left: -9rpx;
border-radius: 0 20rpx 20rpx 0;
}
}
}
}
}
.nav {
padding: 30rpx 20rpx 0;
overflow-x: scroll;
view {
height: 52rpx;
box-sizing: border-box;
padding: 0 18rpx;
border: 4rpx solid transparent;
color: #FFFFFF;
font-size: 32rpx;
}
.active {
border-color: #FFFFFF;
border-radius: 26rpx;
}
}
}
.main-box {
position: relative;
width: 718rpx;
height: 360rpx;
margin: 24rpx 16rpx;
border-radius: 16rpx;
overflow: hidden;
.bg-main {
width: 718rpx;
height: 360rpx;
}
.box-mask {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 200rpx;
box-sizing: border-box;
padding: 20rpx 16rpx 16rpx;
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
color: #FFFFFF;
.one-t {
margin-bottom: 16rpx;
font-size: 46rpx;
line-height: 52rpx;
}
.more-t {
width: 100%;
box-sizing: border-box;
padding-top: 10rpx;
border-top: 1rpx solid #FFFFFF;
font-size: 28rpx;
line-height: 32rpx;
}
}
}
.list-box {
margin-top: 24rpx;
padding: 0 16rpx 34rpx;
.item {
width: 234rpx;
height: 380rpx;
margin-right: 8rpx;
margin-bottom: 24rpx;
border-radius: 12rpx;
background: #FFFFFF;
overflow: hidden;
image {
width: 234rpx;
height: 234rpx;
}
.content {
height: 122rpx;
margin: 6rpx 6rpx 18rpx;
.more-t {
font-size: 28rpx;
line-height: 36rpx;
color: #333333;
}
.price {
font-size: 28rpx;
line-height: 36rpx;
color: #DC1616;
}
.btn {
width: 118rpx;
height: 42rpx;
//background: linear-gradient(180deg, #EFEDC7 0%, #EAC94B 100%);
//border-radius: 4rpx;
//color: #764A00;
//font-size: 24rpx;
}
}
}
.item:nth-child(3n) {
margin-right: 0;
}
}
.img-nodata {
position: relative;
top: 0;
left: 50%;
transform: translate(-50%, 0);
width: 352rpx;
height: 338rpx;
margin-bottom: 60rpx;
}
}
</style>
+86 -95
View File
@@ -36,7 +36,7 @@
</picker> </picker>
<view class="item textarea acea-row row-between"> <view class="item textarea acea-row row-between">
<view>备注说明</view> <view>备注说明</view>
<textarea placeholder="填写备注信息,100字以内" class="num inp" v-model="refundReasonWapExplain"></textarea> <textarea placeholder="填写备注信息,100字以内" class="num" v-model="refundReasonWapExplain"></textarea>
</view> </view>
</view> </view>
<view class="returnBnt bg-color-red" @click="submit">申请退款</view> <view class="returnBnt bg-color-red" @click="submit">申请退款</view>
@@ -44,106 +44,97 @@
</template> </template>
<script> <script>
import { import {
orderDetail, orderDetail,
getRefundReason, getRefundReason,
postOrderRefund postOrderRefund
} from "@/api/order"; } from "@/api/order";
import { import {
trim trim
} from "@/utils"; } from "@/utils";
import { import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from "@/config";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "goodsReturn", name: "goodsReturn",
components: { components: {
// VueCoreImageUpload // VueCoreImageUpload
}, },
mixins: [pageListenMixins], data() {
data() { return {
return { url: `${VUE_APP_API_URL}/upload/image`,
url: `${VUE_APP_API_URL}/upload/image`, headers: {
headers: { Authorization: "Bearer " + this.$store.state.token
Authorization: "Bearer " + this.$store.state.token },
id: 0,
orderInfo: {},
reasonList: [],
reason: "",
refundReasonWapExplain: ""
};
},
methods: {
changeReason(e) {
this.reason = this.reasonList[e.mp.detail.value];
}, },
id: 0, getOrderDetail() {
orderInfo: {}, orderDetail(this.id)
reasonList: [], .then(res => {
reason: "", this.orderInfo = res.data;
refundReasonWapExplain: "", })
pageKeyId: Object.freeze('userOrderRefundApply') .catch(err => {
}; uni.showToast({
}, title: err.msg || err.response.data.msg|| err.response.data.message,
methods: { icon: 'none',
changeReason(e) { duration: 2000
this.reason = this.reasonList[e.mp.detail.value]; });
}, });
getOrderDetail() { },
orderDetail(this.id) getRefundReason() {
.then(res => { getRefundReason().then(res => {
this.orderInfo = res.data; this.reasonList = res.data;
}) });
.catch(err => { },
submit() {
const refundReasonWapExplain = trim(this.refundReasonWapExplain),
text = this.reason;
if (!text) {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: "请选择退款原因",
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
}); return
}, }
getRefundReason() { postOrderRefund({
getRefundReason().then(res => { text,
this.reasonList = res.data; uni: this.orderInfo.orderId,
}); refundReasonWapExplain
}, })
submit() { .then(res => {
const refundReasonWapExplain = trim(this.refundReasonWapExplain), uni.showToast({
text = this.reason; title: res.msg,
if (!text) { icon: "success",
uni.showToast({ duration: 2000
title: "请选择退款原因", });
icon: 'none', setTimeout(() => {
duration: 2000 this.$yrouter.back();
}); }, 1500);
return })
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
} }
postOrderRefund({ },
text, mounted() {
uni: this.orderInfo.orderId, this.id = this.$yroute.query.id || 0;
refundReasonWapExplain this.getOrderDetail();
}) this.getRefundReason();
.then(res => {
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
setTimeout(() => {
this.$yrouter.back();
}, 1500);
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
});
});
} }
}, };
mounted() {
this.id = this.$yroute.query.id || 0;
this.getOrderDetail();
this.getRefundReason();
}
};
</script> </script>
<style scoped>
.apply-return .list .item .inp {
padding: 4rpx 20rpx;
text-align: left;
}
</style>
+98 -401
View File
@@ -1,142 +1,103 @@
<template> <template>
<view class="my-order v12-mx-2" ref="container" @click="handleBody"> <view class="my-order" ref="container">
<view class="m-search-wrap v12-mb-2 v12-mt-3">
<u-search placeholder="请输入商品名/订单号" shape="round" :inputStyle="inputStyle" :showAction="false" bgColor="#FFF" v-model="keyword" @search="changeType"></u-search>
</view>
<view class="m-tab-warp">
<u-tabs
lineHeight="0"
lineColor="#FF564A"
:activeStyle="activeStyle"
:inactiveStyle="inactiveStyle"
:current="type"
:list="tabList"
@click="tabChange">
</u-tabs>
</view>
<!-- <u-tabs lineColor="#FF564A" activeStyle="#FF564A" inactiveStyle="#C2C5CC" :current="type" :list="tabList"
@click="tabChange"></u-tabs> -->
<view class="list v12-ma-0" style="padding: 0rpx 0 30rpx;"> <u-tabs lineColor="#FF564A" activeStyle="#FF564A" inactiveStyle="#C2C5CC" :current="type" :list="tabList"
@click="tabChange"></u-tabs>
<view class="list" style="padding: 80rpx 0 30rpx;">
<view class="item" v-for="(order,orderListIndex) in orderList" :key="orderListIndex"> <view class="item" v-for="(order,orderListIndex) in orderList" :key="orderListIndex">
<view class="shop-info flex jc-between ai-center" v-if="order.merName" @click="goStore(order)"> <view class="shop-info flex jc-between ai-center" v-if="order.merName">
<view class="flex ai-center"> <view class="flex ai-center">
<image :src="webUrl+'/orderIcon/shop.png'" style="width: 32rpx;height: 32rpx"/> <image :src="webUrl+'/20221008152431059973.png'" style="width: 40rpx;height: 40rpx"/>
<text class="name v12-font-weight-400 v12-dark-text v12-font-24">{{ order.merName }}</text> <text class="name">{{ order.merName }}</text>
<image :src="webUrl+'/orderIcon/arrow.png'" style="width: 24rpx;height: 24rpx; margin-top: 5rpx"/>
</view> </view>
<view class="flex ai-center"> <view class="flex ai-center">
<image :src="webUrl+'/orderIcon/map.png'" style="width: 28rpx;height: 28rpx"/> <image :src="webUrl+'/20221008152418897577.png'" style="width: 24rpx;height: 24rpx"/>
<text class="address v12-dark-text v12-font-bold v12-font-24">{{ order.merCityName }}</text> <text class="address">{{ order.merCityName }}</text>
</view> </view>
</view> </view>
<view class="title acea-row row-between-wrapper" style="padding: 0 0 0 30rpx !important;"> <view class="title acea-row row-between-wrapper" style="padding: 0 0 0 30rpx !important;">
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.combinationId > 0">拼团</span> <span class="sign cart-color acea-row row-center-wrapper"
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.seckillId > 0">秒杀</span> v-if="order.combinationId > 0">拼团</span>
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.bargainId > 0">砍价</span> <span class="sign cart-color acea-row row-center-wrapper" v-if="order.seckillId > 0">秒杀</span>
<span class="sign cart-color acea-row row-center-wrapper v12-priamry-text v12-priamry-border v12-radius-40" v-if="order.storeId > 0">门店</span> <span class="sign cart-color acea-row row-center-wrapper" v-if="order.bargainId > 0">砍价</span>
<span class="sign cart-color acea-row row-center-wrapper" v-if="order.storeId > 0">门店</span>
订单号:{{ order.orderId }} 订单号:{{ order.orderId }}
</view> </view>
<view class="font-color-white statusTag v12-primary" v-if="order.isTickets===1 && order._status._type === 1"> <view class="font-color-white statusTag" v-if="order.isTickets===1 && order._status._type === 1">
待核销 待核销
</view> </view>
<view class="font-color-white statusTag v12-primary" v-else>{{ getStatus(order) }}</view> <view class="font-color-white statusTag" v-else>{{ getStatus(order) }}</view>
</view> </view>
<view @click="goOrderDetails(order)"> <view @click="goOrderDetails(order)">
<view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo" <view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex"> :key="cartInfoIndex">
<view class="pictrue"> <view class="pictrue">
<image <image :src="cart.productInfo.image" @click.stop="
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0" $yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:cart.productInfo.id} })
:src="cart.productInfo.image" " v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"/>
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })" <image :src="cart.productInfo.image" @click.stop="
/> $yrouter.push({
<image path: '/pages/activity/GroupDetails/index',query:{id:cart.combinationId}
v-else-if="cart.combinationId > 0" })
:src="cart.productInfo.image" " v-else-if="cart.combinationId > 0"/>
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })" <image :src="cart.productInfo.image" @click.stop="
/> $yrouter.push({
<image path: '/pages/activity/DargainDetails/index',query:{id:cart.bargainId}
v-else-if="cart.bargainId > 0" })
:src="cart.productInfo.image" " v-else-if="cart.bargainId > 0"/>
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })" <image :src="cart.productInfo.image" @click.stop="
/> $yrouter.push({
<image path: '/pages/activity/SeckillDetails/index',query:{id:cart.seckillId}
v-else-if="cart.seckillId > 0" })
:src="cart.productInfo.image" " v-else-if="cart.seckillId > 0"/>
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
/>
</view> </view>
<view class="text"> <view class="text acea-row row-between">
<view class="acea-row name-wrap"> <view class="acea-row row-column" style="width: 100%">
<view class="name more-t v12-font-bold">{{ cart.productInfo.storeName }}</view> <view class="name line2">{{ cart.productInfo.storeName }}</view>
<view class="money"> <view class="attr line1" style="color: #999999;" v-if="cart.productInfo.attrInfo">
<view> 属性{{ cart.productInfo.attrInfo.sku }}
<text class="v12-font-22"></text>
<text class="v12-font-28">{{ force2Decimal(cart.truePrice) }}</text>
</view>
</view> </view>
</view> </view>
<view class="acea-row attr-wrap "> <view class="money">
<view <view>{{ force2Decimal(cart.truePrice) }}</view>
v-if="cart.productInfo.attrInfo" <view>x{{ cart.cartNum }}</view>
class="attr v12-secondary-dark-text v12-font-24 "
>
{{ cart.productInfo.attrInfo.sku }}
</view>
<view class="v12-dark-text v12-font-22">x{{ cart.cartNum }}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="totalPrice acea-row row-between row-middle"> <view class="totalPrice acea-row row-between row-middle">
<view class="" v-if="order.createTime"><span class="orderTime v12-font-24 v12-dark1-text">{{ order.createTime }}</span></view> <view class="" v-if="order.createTime"><span class="orderTime">{{ order.createTime }}</span></view>
<view class="v12-font-24 v12-dark1-text">{{ order.totalNum || 0 }}件商品 <view class="">{{ order.totalNum || 0 }}件商品总金额
<text class="v12-dark-text v12-font-28 v12-font-bold"> <text class="money font-color-lightred">{{ force2Decimal(order.payPrice) }}</text>
总金额
</text>
<text class="v12-font-22 v12-primary-text v12-font-bold">
</text>
<text class="money font-color-lightred v12-font-28 v12-primary-text v12-font-bold">{{ force2Decimal(order.payPrice) }}</text>
</view> </view>
</view> </view>
<view class="bottom flex jc-between ai-center"> <view class="bottom flex jc-between ai-center">
<view class="group-btn" <view class="group-btn"
v-if="(Number(order._status._type) === 2 || Number(order._status._type) === 3) && v-if="(Number(order._status._type) === 2 || Number(order._status._type) === 3) &&
order.isTickets === 0"> order.isTickets === 0">
<text class="btn-more v12-font-28 v12-font-bold" @click.stop="tapShowMore(order,orderListIndex)">更多</text> <text class="btn-more" @click="tapShowMore(order,orderListIndex)">更多</text>
<view class="group-float" v-show="order.showMore"> <view class="group-float" v-show="order.showMore">
<view class="btn btn-service flex jc-center ai-center v12-font-24" @click="goRoom(order)" <view class="btn btn-service flex jc-center ai-center" @click="goRoom(order)"
v-if="order.merName">联系商家 v-if="order.merName">联系客服
</view> </view>
<view class="btn flex jc-center ai-center v12-font-24" @click="goRefund(order)">申请退款</view> <view class="btn flex jc-center ai-center" @click="goRefund(order)">申请退款</view>
</view> </view>
</view> </view>
<template v-else> <template v-else>
<view class="v12-justify-between" style="width: 100%"> <view class="bnt service" @click="goRoom(order)" v-if="order.merName">联系客服</view>
<view> <view v-else></view>
<view class="bnt service" @click="goRoom(order)" v-if="order.merName && order._status._type != 0 && Number(order._status._type) !== 9">联系商家</view>
</view>
<view class="v12-justify-between">
<view class="bnt service" @click="goOrderDetails(order)" v-if="['-1','-2','-3'].includes(order._status._type)">查看详情</view>
<view class="bnt service" @click="delOrder(order)" v-if="['9'].includes(order._status._type)">删除订单</view>
<!-- <view class="bnt v12-primary-text v12-primary-border" @click="takeOrder(order)" v-if="['-2','-3'].includes(order._status._type)">确认收货</view> -->
</view>
</view>
<!-- <view v-else></view> -->
</template> </template>
<view class="flex"> <view class="flex">
<template v-if="order._status._type == 0"> <template v-if="order._status._type == 0">
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="cancelOrder(order)">取消订单</view> <view class="bnt cancelBnt" @click="cancelOrder(order)">取消订单</view>
<view class="bnt cancelBnt v12-dark-text v12-dark-border" @click="addressTap(order)">修改地址</view> <view class="bnt bg-color-lightred" @click="goOrderDetails(order)">立即付款</view>
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="subscribePay(order)">立即付款</view>
</template> </template>
<template v-if="(order._status._type == 1 ) && order.isTickets==0"> <template v-if="(order._status._type == 1 || order._status._type == 9) && order.isTickets==0">
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">查看详情</view> <view class="bnt bg-color-lightred" @click="goOrderDetails(order)">查看详情</view>
</template> </template>
<template v-if="order._status._type == 1 && order.isTickets == 1"> <template v-if="order._status._type == 1 && order.isTickets == 1">
<view class="bnt bg-color-lightred" @click="goOrderDetails(order)">立即核销</view> <view class="bnt bg-color-lightred" @click="goOrderDetails(order)">立即核销</view>
@@ -145,31 +106,23 @@
<view class="bnt default" v-if="order.isExtendedDelivery==0" <view class="bnt default" v-if="order.isExtendedDelivery==0"
@click="toDelay(order.orderId)">延长收货 @click="toDelay(order.orderId)">延长收货
</view> </view>
<view class="bnt default v12-radius-40" @click="goLogistics(order)">查看物流</view> <view class="bnt default" @click="goLogistics(order)">查看物流</view>
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="takeOrder(order)">确认收货</view> <view class="bnt bg-color-lightred" @click="takeOrder(order)">确认收货</view>
</template> </template>
<template v-if="order._status._type == 3"> <template v-if="order._status._type == 3">
<view class="bnt bg-color-lightred v12-white v12-primary-text v12-primary-border v12-radius-40" @click="goOrderDetails(order)">去评价</view> <view class="bnt bg-color-lightred" @click="goOrderDetails(order)">去评价</view>
</template> </template>
<template v-if="order._status._type === 4"> <template v-if="order._status._type === 4">
<view class="bnt bg-color-lightred" @click="goOrderDetails(order)">查看订单</view> <view class="bnt bg-color-lightred" @click="goOrderDetails(order)">查看订单</view>
</template> </template>
</view> </view>
</view> </view>
<view class="v12-px-3 v12-pb-4" v-if="order._status._type == 1">
<view class="v12-font-22 v12-secondary-dark-text order-tips" v-if="order.isFastPost !== 0">商家已接收您的订单,支付成功后预计{{ order.isFastPost === 1 ? 48 : 72 }}小时内发货</view>
</view>
</view> </view>
</view> </view>
<u-modal <u-modal :show="showExtend" title="确认延长收货时间?" content='每笔订单只能延长一次哦' showCancelButton
:show="showExtend" @cancel="showExtend=false" @confirm="doneDelay"></u-modal>
title="确认延长收货时间?"
content='每笔订单只能延长一次哦'
showCancelButton
@cancel="showExtend=false"
@confirm="doneDelay">
</u-modal>
<view class="noCart" v-if="orderList.length === 0 && page > 1"> <view class="noCart" v-if="orderList.length === 0 && page > 1">
<view class="pictrue"> <view class="pictrue">
<image :src="webUrl+'/20240102232734472795.png'"/> <image :src="webUrl+'/20240102232734472795.png'"/>
@@ -177,57 +130,25 @@
</view> </view>
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment> <Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
<passkeyborad
:money="orderInfo.payPrice"
showMoney
:show="isShowPayPwdPop"
ref='payPwdPop'
@close="pwdPopClose"
@finish="pwdPopFinish"
></passkeyborad>
</view> </view>
</template> </template>
<script> <script>
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard' import {getOrderData, getOrderList, orderDelay} from "@/api/order";
import {getOrderData, getOrderList, orderDelay, editAddress } from "@/api/order"; import {cancelOrderHandle, payOrderHandle, takeOrderHandle} from "@/libs/order";
import {cancelOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle, delOrderHandle} from "@/libs/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import Payment from "@/components/Payment"; import Payment from "@/components/Payment";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "MyOrder", name: "MyOrder",
mixins: [pageListenMixins],
data() { data() {
return { return {
isShowPayPwdPop: false,
inputStyle: {
height: '64rpx',
},
activeStyle: {
color: '#C52733',
background: 'rgba(197,39,51,0.1)',
borderRadius: '30rpx',
padding: '5rpx 20rpx',
fontWeight: '600'
},
inactiveStyle: {
height: '48rpx !important',
background: '#fff !important',
borderRadius: '30rpx !important',
color: '#333333 !important',
padding: '5rpx 15rpx',
fontSize: '28rpx !important',
lineHeight: '48rpx !important'
},
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
tabList: [ tabList: [
{name: '全部'}, {name: '全部'},
{name: '待付款'}, {name: '待付款'},
{name: '待发货'}, {name: '待发货'},
{name: '待收货/待核销'}, {name: '待收货/待核销'},
{name: '退款/售后'},
{name: '待评价'}, {name: '待评价'},
{name: '已完成'}], {name: '已完成'}],
offlinePayStatus: 2, offlinePayStatus: 2,
@@ -241,174 +162,42 @@ export default {
pay: false, pay: false,
payType: ["yue", "weixin"], payType: ["yue", "weixin"],
from: this.$deviceType, from: this.$deviceType,
orderInfo: {},
showExtend: false, showExtend: false,
delayId: null, delayId: null,
pageKeyId: Object.freeze('userOrderIndex'),
keyword: '',
_orderId: '',
addressId: '',
}; };
}, },
components: { components: {
Loading, Loading,
Payment, Payment
passkeyborad
}, },
computed: mapGetters(["userInfo"]), computed: mapGetters(["userInfo"]),
onShow() { onShow: function () {
this.type = this.type || parseInt(this.$yroute.query.type) || 0; this.type = parseInt(this.$yroute.query.type) || 0;
this.changeType(this.type); this.changeType(this.type);
this.getOrderData(); this.getOrderData();
this.getOrderListReq(); this.getOrderList();
uni.$on('chooseAddress', (res) => {
this.addressId = res.id
})
}, },
onHide() { onHide: function () {
this.orderList = []; this.orderList = [];
this.page = 1; this.page = 1;
this.limit = 20; this.limit = 20;
this.loaded = false; this.loaded = false;
this.loading = false; this.loading = false;
}, },
watch: {
addressId(val) {
if(val) {
const params = {
addressId: this.addressId,
orderId: this._orderId
}
setTimeout(() => {
uni.showModal({
title:'确定修改地址吗?',
content: '',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success:(success)=>{
if(success.confirm) {
uni.showLoading()
editAddress(params).then(res => {
uni.showToast({
icon: 'success',
title: '修改成功!'
})
}).finally(() => {
uni.hideLoading()
})
}
},
complete:(complete)=>{
this.addressId = ''
this._orderId = ''
},
})
}, 1000)
}
}
},
methods: { methods: {
handleBody() {
this.orderList.forEach((e) => {
e.showMore = false
})
this.$forceUpdate()
},
delOrder(order) {
delOrderHandle(order.orderId).then(() => {
// this.goBack()
this.page = 1
this.orderList = [];
this.getOrderListReq()
})
},
goStore(order) {
if(!order.hotelId) {
uni.showToast({
title: '未找到相关店铺!'
})
return
}
this.$yrouter.push({
path: "/pagesInn/inn/innHome",
query: {
id: order.hotelId
}
});
},
async toYuePay(payPwd) {
const that = this;
//网络请求
await yuePayOrderHandle(this.orderInfo.orderId, "yue", that.from, payPwd);
that.changeType();
this.payPassword = "";
},
pwdPopClose() {
this.isShowPayPwdPop = false;
},
pwdPopFinish(payPwd) {
this.payPassword = payPwd;
this.toYuePay(payPwd);
this.isShowPayPwdPop = false;
},
subscribePay(order) {
this.orderInfo = order
uni.requestSubscribeMessage({
tmplIds: ['7O3wKw7_D4t7yfSOlvecKuOQP8QEPY88uBx2FJg43HE', 'TSmTnGibZ8IxWCiRWOvLxha6-0u7tE-V1-WbDCiPkKU', '9Q6xLHe6HyjkU5Zn5k_2zxYPf2y4MxVyUbOSW8pcZRU'],
complete: () => this.pay = true
})
},
addressTap(order) {
this._orderId = order.orderId
this.$yrouter.push({
path: "/pages/user/address/AddressManagement/index",
query: {
choosMode: 1
}
});
},
force2Decimal(v) { force2Decimal(v) {
return this.$force2Decimal(v); return this.$force2Decimal(v);
}, },
goRoom(order) { goRoom(order) {
const params = {
goodsId: order.cartInfo[0].productId,
goodsName: order.cartInfo[0].productInfo.storeName,
skuStr: order.cartInfo[0].productInfo.attrInfo.sku,
price: order.cartInfo[0].productInfo.attrInfo.price,
seckillId: order.cartInfo[0].seckillId,
cover: order.cartInfo[0].productInfo.attrInfo.image,
goodsData: '',
seckillData: ''
}
uni.navigateTo({ uni.navigateTo({
url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}&params=${JSON.stringify(params)}` url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}`
}) })
}, },
goRefund(order) { goRefund(order) {
// fix bug#1631 uni.navigateTo({
if (this.type === 4 || parseInt(order._status._type) === 3) { url: `/pkg_orders/views/refund?id=${order.orderId}`
// 打开售后的目的就是开启已完成/待评价订单的退款功能,确认打开售后之后,小程序用户再点击申请退款,就可以进入退款申请填写页面,正常走退款流程,提交退款申请以后,订单状态变为退款中 })
if (order.refundSystemStatus === 0) {
uni.showToast({
title: '订单已收货,如需退款请联系商家',
mask: false,
icon: 'none',
duration: 3000
})
} else {
uni.navigateTo({
url: `/pkg_orders/views/refund?id=${order.orderId}`
})
}
} else {
uni.navigateTo({
url: `/pkg_orders/views/refund?id=${order.orderId}`
})
}
}, },
goLogistics(order) { goLogistics(order) {
this.$yrouter.push({ this.$yrouter.push({
@@ -435,30 +224,6 @@ export default {
} }
} }
}, },
gotoGoodDetail(cart, type, query){
// isProductStillExist:0-不存在,1-存在
const isProductStillExist = cart.isProductStillExist || 0
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
}
let path = ''
switch(type) {
case 1:
path = '/pages/shop/GoodsCon/index'
break
case 2:
path = '/pages/activity/GroupDetails/index'
break
case 3:
path = '/pages/activity/DargainDetails/index'
break
case 4:
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
},
getOrderData() { getOrderData() {
getOrderData().then(res => { getOrderData().then(res => {
this.orderData = res.data; this.orderData = res.data;
@@ -487,9 +252,7 @@ export default {
this.changeType(this.type); this.changeType(this.type);
}, },
tabChange(item) { tabChange(item) {
this.type = item.index;
this.type = item.index
this.changeType(); this.changeType();
}, },
changeType() { changeType() {
@@ -497,31 +260,20 @@ export default {
this.page = 1; this.page = 1;
this.loaded = false; this.loaded = false;
this.loading = false; this.loading = false;
this.getOrderListReq(); this.getOrderList();
}, },
getOrderListReq() { getOrderList() {
if (this.loading || this.loaded) return; if (this.loading || this.loaded) return;
this.loading = true; this.loading = true;
const types = {
0: 0,
1: 1,
2: 2,
3: 3,
4: -3,
5: 4,
6: 5,
}
const type = types[this.type]
const { const {
page, page,
limit, limit,
keyword type
} = this; } = this;
getOrderList({ getOrderList({
page, page,
limit, limit,
type, type
keyword
}).then(res => { }).then(res => {
this.orderList = this.orderList.concat(res.data); this.orderList = this.orderList.concat(res.data);
if (this.orderList.length > 0) { if (this.orderList.length > 0) {
@@ -532,9 +284,6 @@ export default {
this.page++; this.page++;
this.loaded = res.data.length < this.limit; this.loaded = res.data.length < this.limit;
this.loading = false; this.loading = false;
}).finally(() => {
this.loading = false;
// console.log('???',this.loading);
}); });
}, },
tapShowMore(order, index) { tapShowMore(order, index) {
@@ -564,15 +313,10 @@ export default {
status = "退款中"; status = "退款中";
break; break;
case -2: case -2:
status = "退款成功"; status = "退款";
break; break;
case -3: case -3:
status = "退款失败"; status = "已驳回";
break;
case 9:
status = "已取消";
break;
default:
break; break;
} }
return status; return status;
@@ -588,7 +332,7 @@ export default {
}); });
}, },
paymentTap: function (order) { paymentTap: function (order) {
const that = this; var that = this;
if ( if (
!(order.combinationId > 0 || order.bargainId > 0 || order.seckillId > 0) !(order.combinationId > 0 || order.bargainId > 0 || order.seckillId > 0)
) { ) {
@@ -609,16 +353,7 @@ export default {
}); });
}; };
}, },
toPay(type) { toPay() {
const that = this;
console.log(type, "支付方式");
//余额支付需要输入支付密码
if (type == "yue") {
this.isShowPayPwdPop = true;
return;
} else {
payOrderHandle(this.orderInfo.orderId, type, that.from);
}
}, },
toDelay(id) { toDelay(id) {
@@ -633,39 +368,16 @@ export default {
} }
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getOrderListReq(); !this.loading && this.getOrderList();
} }
}; };
</script> </script>
<style>
.my-order .u-tabs{
background-color: transparent !important;
position: sticky !important;
}
.my-order .u-tabs__wrapper__nav__item{
padding: 0 8rpx !important;
}
.my-order .u-search__content{
box-shadow: 0rpx 6rpx 12rpx rgba(0,0,0,0.1);
}
</style>
<style scoped lang="less"> <style scoped lang="less">
page { page {
background-color: #fff; background-color: #fff;
} }
.order-tips{
height: 44rpx;
background: rgba(0,0,0,0.05);
border-radius: 40rpx;
padding: 5rpx 24rpx;
line-height: 44rpx;
}
.m-tab-warp{
position: sticky;
top: 0;
background-color: #f5f5f5;
}
/deep/ .u-tabs { /deep/ .u-tabs {
position: fixed; position: fixed;
z-index: 1; z-index: 1;
@@ -675,16 +387,13 @@ page {
} }
.list { .list {
.item:first-child{
margin-top: 0;
}
.item { .item {
margin: 30rpx 0; margin: 30rpx 0;
border-radius: 12rpx; border-radius: 12rpx;
.shop-info { .shop-info {
padding: 20rpx 16rpx; padding: 20rpx 16rpx;
// border-bottom: 2rpx solid #eee; border-bottom: 2rpx solid #DADADA;
.name { .name {
margin-left: 6rpx; margin-left: 6rpx;
@@ -708,7 +417,8 @@ page {
.item-info { .item-info {
margin: 0 30rpx; margin: 0 30rpx;
padding: 0 0 0 0; padding: 22rpx 0 0;
border-top: 1rpx solid #eee;
} }
.totalPrice { .totalPrice {
@@ -716,25 +426,22 @@ page {
} }
.bottom { .bottom {
border-top: 0rpx solid #eee; border-top: 2rpx solid #DADADA;
.bnt { .bnt {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 128rpx; width: 160rpx;
height: 44rpx; height: 56rpx;
border-radius: 40rpx; box-sizing: border-box;
border-radius: 20rpx;
font-size: 24rpx; font-size: 24rpx;
// font-weight: bold;
border: 1px solid #707070;
color: #333;
padding: 1px 3px;
} }
.service { .service {
border: 1px solid #707070; border: 2rpx solid #0DC5C5;
color: #333; color: #0DC5C5;
} }
} }
} }
@@ -758,13 +465,13 @@ page {
} }
.statusTag { .statusTag {
font-size: 24rpx; font-size: 20rpx;
color: #fff; color: #fff;
padding: 4rpx 20rpx; padding: 0 20rpx;
background: #0DC5C5; background: #0DC5C5;
height: 38rpx; height: 38rpx;
line-height: 38rpx; line-height: 38rpx;
border-radius: 60rpx 0px 0px 60rpx; border-radius: 20rpx 0px 0px 20rpx;
} }
.group-btn { .group-btn {
@@ -796,14 +503,4 @@ page {
} }
} }
} }
.my-order .list .item .item-info .name-wrap,
.my-order .list .item .item-info .attr-wrap {
justify-content: space-between;
}
.my-order .list .item .item-info .attr-wrap {
margin: 10rpx 0 0 0;
}
.my-order .list .item .item-info .text .name {
width: calc(100% - 160rpx);
}
</style> </style>
+88 -462
View File
@@ -1,54 +1,25 @@
<template> <template>
<view class="order-details" style="padding: 30rpx;" @click="handleBody"> <view class="order-details" style="padding: 30rpx;">
<!-- 给header上与data上加on为退款订单--> <!-- 给header上与data上加on为退款订单-->
<view class=" v12-pa-3 v12-white" :class="refundOrder ? 'on' : ''" style="border-radius: 20rpx;"> <view class="header acea-row row-middle" :class="refundOrder ? 'on' : ''"
<!-- <view class="status-img-box"> style="background: #0DC5C5;border-radius: 24rpx;">
<view class="status-img-box">
<image class="status-img" :src="getStatusImg(orderInfo)" mode=""></image> <image class="status-img" :src="getStatusImg(orderInfo)" mode=""></image>
</view> --> </view>
<view :class="refundOrder ? 'on' : ''"> <view class="data" :class="refundOrder ? 'on' : ''">
<view class="state v12-primary-text v12-font-32 v12-font-bold" v-if="orderInfo.isTickets===1 && orderInfo._status._type == 2">待核销</view> <view class="state" v-if="orderInfo.isTickets===1 && orderInfo._status._type == 2">待核销</view>
<view class="state v12-primary-text v12-font-32 v12-font-bold" v-else>{{ getStatus(orderInfo) }}</view> <view class="state" v-else>{{ getStatus(orderInfo) }}</view>
<view v-if="getStatus(orderInfo)!=='待付款'" class="v12-mt-2 v12-font-24 v12-secondary-dark-text" :class="{'fails-bg': orderInfo._status._type == -3}">{{ orderInfo._status._msg }}</view> <view v-if="getStatus(orderInfo)!=='待付款'">{{ orderInfo._status._msg }}</view>
<view class="pending-payments flex ai-center v12-mt-2 v12-font-24 v12-secondary-dark-text" v-else> <view class="pending-payments flex ai-center" v-else>
<text>需支付{{ orderInfo.payPrice }}</text> <text>请在</text>
<!-- {{ orderInfo.paymentTimeout }} --> <u-count-down :time="$global.diffSSS(this.orderInfo.paymentTimeout)"/>
剩余<u-count-down format="HH:mm:ss" autoStart :time="$global.diffSSS(orderInfo.paymentTimeout)" />订单将自动取消 <text>内支付逾期订单将自动取消</text>
</view> </view>
<u-divider></u-divider>
<div class="name v12-mb-3 v12-font-28 v12-font-bold">
<text class="v12-mr-3"> {{ orderInfo.realName }}</text>
<text class="phone">{{ orderInfo.userPhone }}</text>
</div>
<div class="v12-font-28 v12-secondary-dark-text v12-justify-between">
<text class=" more-t" style="flex: 2;">{{ orderInfo.userAddress }}</text>
<view v-if="getStatus(orderInfo) === '待付款'" @click="goAddress" class="v12-btn cancel v12-dark-text v12-dark-border v12-radius-40" >修改地址</view>
</div>
</view> </view>
</view> </view>
<!-- <view class="reject-reason" v-if="orderInfo._status._type==-3 && orderInfo.refundRejectReason">驳回原因{{ orderInfo.refundRejectReason }}</view> --> <view class="reject-reason" v-if="orderInfo._status._type==-3 && orderInfo.refundRejectReason">驳回原因{{ orderInfo.refundRejectReason }}</view>
<view @click="goLogistics(orderInfo)" class="v12-radius-20 v12-white v12-pa-3 v12-mt-4" v-if="orderInfo._status._type == 3 || (orderInfo._status._type == 2 && orderInfo.isTickets!==1)">
<view >
<text class="v12-secondary-dark-text v12-font-28">{{ orderInfo.deliveryName }}{{ orderInfo.deliveryId }}</text>
<text class="v12-font-22 v12-px-2 v12-py-1 v12-ml-1 v12-primary-text v12-primary-border v12-radius-40" @click="copyClipboard(orderInfo.orderId)">
复制
</text>
</view>
<view class="v12-mt-2 v12-justify-between">
<view class="v12-align-center">
<view class="v12-align-center v12-mr-2">
<image class="logo" :src="webUrl+'/orderIcon/car.png'" mode="" style="margin-right:0; width: 32rpx; height:32rpx"/>
</view>
<view class="v12-font-28 v12-secondary-dark-text">{{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptStation : '暂无轨迹信息'}}</view>
</view>
<view>
<uni-icons type="right" size="20" color="#707070"></uni-icons>
</view>
</view>
<view class="v12-mt-2">
<text class="v12-dark-text v12-font-24">{{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptTime : '' }}</text>
</view>
</view>
<template v-if="!refundOrder"> <template v-if="!refundOrder">
<view class="code-box flex jc-center ai-center" v-if="orderInfo.isTickets===1 && orderInfo._status._type==2"> <view class="code-box flex jc-center ai-center" v-if="orderInfo.isTickets===1 && orderInfo._status._type==2">
<image class="code-img" :src="orderInfo.code"/> <image class="code-img" :src="orderInfo.code"/>
@@ -90,10 +61,28 @@
<span class="iconfont icon-weizhi"></span>查看位置 <span class="iconfont icon-weizhi"></span>查看位置
</div> </div>
</div> </div>
<view class="address acea-row row-middle" style="margin-top: 30rpx;border-radius: 24rpx;flex-wrap: nowrap;"
<div class="address" v-if="orderInfo.shippingType !== 1"> v-if="orderInfo.shippingType === 1">
<view class="" style="flex-shrink: 0;margin-right: 20rpx;">
<image style="width: 48rpx;height: 48rpx;" :src="webUrl+'/20230304135530688212.png'" mode=""></image>
</view>
<view class="acea-row row-middle" style="flex-grow: 1;">
<view class="name acea-row row-middle row-between" style="flex-wrap: nowrap;width: 100%;">
<view class="acea-row row-middle">
{{ orderInfo.realName }}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view class="acea-row row-middle">
<image style="width: 32rpx;height: 32rpx;" :src="webUrl+'/20210808005541949297.png'" mode=""
@click="call(orderInfo.userPhone)"></image>
</view>
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
</view>
<div class="address" v-else>
<div class="name"> <div class="name">
{{ system_store.name }} {{ system_store.name }}
<span class="phone">{{ system_store.phone }}</span> <span class="phone">{{ system_store.phone }}</span>
<span class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span> <span class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span>
</div> </div>
@@ -102,139 +91,50 @@
</template> </template>
</template> </template>
<view style="margin-top: 30rpx;border-radius:20rpx;overflow: hidden;" class="v12-white"> <view style="margin-top: 30rpx;border-radius:24rpx;overflow: hidden;">
<!-- <OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []" title="商品信息"></OrderGoods> --> <OrderGoods :evaluate="status.type || 0" :cartInfo="orderInfo.cartInfo || []" title="商品信息"></OrderGoods>
<view class="v12-radius-20 v12-pa-3" v-for="(cart, d) in orderInfo.cartInfo" :key="d">
<view class="v12-justify-between">
<view class="">
<image style="width: 120rpx; height: 120rpx" class="v12-radius-8" :src="cart.productInfo.image"></image>
</view>
<view class="v12-justify-between v12-flex-column v12-ml-2" style="flex: 2">
<view class="v12-font-28 v12-dark-text v12-font-bold more-t">
{{ cart.productInfo.storeName }}
</view>
<view v-if="cart.productInfo.attrInfo" class="more-t v12-secondary-dark-text v12-font-24">
{{ cart.productInfo.attrInfo.sku }}
</view>
</view>
<view class="v12-justify-between v12-flex-column v12-dark-text v12-text-right">
<view class=" ">
<text class="v12-font-22">
</text>
<text class="v12-font-28">{{ cart.truePrice }}</text>
</view>
<view class="v12-font-22">
<text>x{{ cart.cartNum }}</text>
</view>
</view>
</view>
<view class="" v-if="orderInfo.cartInfo &&( d === orderInfo.cartInfo.length - 1)">
<view class="v12-justify-between v12-mt-3 v12-dark-text">
<view class="v12-font-24 v12-dark-text">
商品总价
</view>
<view class="v12-text-right">
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.totalPrice) }}
</text>
</view>
</view>
<view class="v12-justify-between v12-mt-3" v-if="orderInfo.payPostage > 0">
<view class="v12-font-24 v12-dark-text">
运费
</view>
<view class="v12-text-right">
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.payPostage) }}
</text>
</view>
</view>
<view class="v12-justify-between v12-mt-3" v-if="orderInfo.couponPrice > 0">
<view class="v12-font-24 v12-dark-text">
满减优惠
</view>
<view class="v12-text-right">
-
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.couponPrice) }}
</text>
</view>
</view>
<view class="v12-justify-between v12-mt-3" v-if="orderInfo.useIntegral > 0">
<view class="v12-font-24 v12-dark-text">
积分抵扣
</view>
<view class="v12-text-right">
-
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.deductionPrice) }}
</text>
</view>
</view>
<u-divider></u-divider>
<view class="v12-justify-between v12-mt-3">
<view class="v12-font-28 v12-font-bold v12-dark-text">
实付款
</view>
<view class="v12-text-right v12-font-bold v12-primary-text">
<text class="v12-font-22"></text>
<text class="v12-font-28">
{{ force2Decimal(orderInfo.payPrice) }}
</text>
</view>
</view>
</view>
</view>
</view> </view>
<view class="wrapper v12-radius-20 v12-mt-7" style="margin-top: 30rpx"> <view class="wrapper" style="margin-top: 30rpx;border-radius: 24rpx;">
<!-- <view class="item acea-row row-middle" <view class="item acea-row row-middle"
style="font-size: 40rpx;color: #080F1A;font-weight: bold;flex-wrap: nowrap;"> style="font-size: 40rpx;color: #080F1A;font-weight: bold;flex-wrap: nowrap;">
<image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210808003431044270.png'" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210808003431044270.png'"
mode=""></image> mode=""></image>
<text style="font-size: 26rpx;color: #080F1A;">订单信息</text> <text style="font-size: 26rpx;color: #080F1A;">订单信息</text>
</view> --> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text "> <view class="item acea-row row-between">
<view class="flex-0">订单编号</view> <view class="flex-0">订单编号</view>
<view class="v12-text-right "> <view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId }} {{ orderInfo.orderId }}
<text class="v12-px-2 v12-py-1 v12-ml-1 v12-primary-text v12-primary-border v12-radius-40" @click="copyClipboard(orderInfo.orderId)"> <image @click="copyClipboard(orderInfo.orderId)" style="width: 28rpx;height: 28rpx;margin-left: 10rpx;"
复制 :src="webUrl+'/20210808003517657208.png'" mode=""></image>
</text>
<!-- <image @click="copyClipboard(orderInfo.orderId)" style="width: 28rpx;height: 28rpx;margin-left: 10rpx;"
:src="webUrl+'/20210808003517657208.png'" mode=""></image> -->
</view> </view>
</view> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text "> <view class="item acea-row row-between">
<view class="flex-0">下单时间</view> <view class="flex-0">下单时间</view>
<view class="v12-text-right"> <view class="conter">
<text>{{ orderInfo.createTime }}</text> <text>{{ orderInfo.createTime }}</text>
</view> </view>
</view> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text "> <view class="item acea-row row-between">
<view class="flex-0">订单类型</view> <view class="flex-0">订单类型</view>
<view class="v12-text-right">{{ orderTypeName }}</view> <view class="conter">{{ orderTypeName }}</view>
</view> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text "> <view class="item acea-row row-between">
<view class="flex-0">支付状态</view> <view class="flex-0">支付状态</view>
<view class="v12-text-right">{{ orderInfo.paid ? "已支付" : "未支付" }}</view> <view class="conter">{{ orderInfo.paid ? "已支付" : "未支付" }}</view>
</view> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text "> <view class="item acea-row row-between">
<view class="flex-0">支付方式</view> <view class="flex-0">支付方式</view>
<view class="v12-text-right">{{ orderInfo._status._payType }}</view> <view class="conter">{{ orderInfo._status._payType }}</view>
</view> </view>
<view class="item acea-row row-between v12-font-24 v12-dark-text" v-if="orderInfo.mark"> <view class="item acea-row row-between" v-if="orderInfo.mark">
<view class="flex-0">买家备注</view> <view class="flex-0">买家留言</view>
<view class="v12-text-right conttent-left">{{ orderInfo.mark }}</view> <view class="conter">{{ orderInfo.mark }}</view>
</view> </view>
</view> </view>
<view v-if="false"> <view v-if="orderInfo.status != 0">
<view class="wrapper" v-if="true"> <view class="wrapper" v-if="true">
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view class="flex-0">配送方式</view> <view class="flex-0">配送方式</view>
@@ -269,7 +169,7 @@
</view> </view>
</view> </view>
<!-- 退款订单详情 --> <!-- 退款订单详情 -->
<view class="wrapper" v-if="false"> <view class="wrapper" v-if="refundOrder">
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>收货人</view> <view>收货人</view>
<view class="conter">{{ orderInfo.realName }}</view> <view class="conter">{{ orderInfo.realName }}</view>
@@ -283,7 +183,7 @@
<view class="conter">{{ orderInfo.userAddress }}</view> <view class="conter">{{ orderInfo.userAddress }}</view>
</view> </view>
</view> </view>
<view v-if="false" class="wrapper" style="margin-top: 30rpx;border-radius: 24rpx;"> <view class="wrapper" style="margin-top: 30rpx;border-radius: 24rpx;">
<view class="item acea-row row-between" style="flex-wrap: nowrap;"> <view class="item acea-row row-between" style="flex-wrap: nowrap;">
<view class="acea-row row-middle" style="font-size: 40rpx;color: #080F1A;font-weight: bold;flex-wrap: nowrap;"> <view class="acea-row row-middle" style="font-size: 40rpx;color: #080F1A;font-weight: bold;flex-wrap: nowrap;">
<image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210808003453973795.png'" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210808003453973795.png'"
@@ -312,107 +212,36 @@
<view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view> <view style="height:100rpx;" v-if="!refundOrder && offlineStatus"></view>
<view class="footer acea-row row-right row-middle" v-if="!refundOrder && offlineStatus"> <view class="footer acea-row row-right row-middle" v-if="!refundOrder && offlineStatus">
<template v-if="status.type == 0"> <template v-if="status.type == 0">
<view class="v12-justify-between v12-align-center full-width" style="width: 100%"> <view class="bnt cancel" @click="cancelOrder">取消订单</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view> <view class="bnt bg-color-red" @click="subscribePay">立即付款</view>
<view class="v12-justify-between v12-align-center">
<view class="">
<text class="v12-font-22 v12-dark1-text">
{{ orderInfo.totalNum }}件商品
</text>
<text class="v12-font-bold v12-dark-text v12-font-28 v12-mx-2">
实付款
</text>
<text class="v12-font-bold v12-primary-text v12-font-22">
</text>
<text class="v12-font-bold v12-primary-text v12-font-28">
{{ force2Decimal(orderInfo.payPrice) }}
</text>
</view>
<view class="bnt v12-primary-text v12-primary-border v12-ml-1" @click="subscribePay">立即付款</view>
</view>
</view>
</template> </template>
<template v-if="status.type == 1" > <template v-if="status.type == 1">
<view class="v12-justify-between " style="width: 100%"> <view class="bnt cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="bnt v12-primary-text v12-primary-border cancel" @click="goGoodsReturn(orderInfo)">申请退款</view>
</view>
</template> </template>
<template v-if="status.type == 2"> <template v-if="status.type == 2">
<view class="v12-justify-between " style="width: 100%"> <view class="bnt default"
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view> @click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
<view class="v12-justify-between"> v-if="orderInfo.isTickets!==1">查看物流
<view class="" style="position: relative">
<text class="btn-more v12-font-24 v12-mr-2" @click.stop="showMore = !showMore">更多</text>
<view class="group-float" v-show="showMore" :style="{top: orderInfo.isExtendedDelivery==0 ? '-60px' : '-32px'}">
<view v-if="orderInfo.isExtendedDelivery==0" class="btn flex jc-center ai-center v12-font-24" @click="toDelay(orderInfo.orderId)">延长收货</view>
<view class="btn flex jc-center ai-center v12-font-24" @click="goGoodsReturn(orderInfo)">申请退款</view>
</view>
</view>
<view class="bnt v12-dark-text v12-dark-border default"
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
v-if="orderInfo.isTickets!==1">查看物流
</view>
<view class="bnt v12-primary-text v12-primary-border" @click="takeOrder">确认收货</view>
</view>
</view> </view>
<view class="bnt bg-color-red" @click="takeOrder">确认收货</view>
</template> </template>
<template v-if="status.type == 3"> <template v-if="status.type == 3">
<view class="v12-justify-between " style="width: 100%"> <view class="bnt default" @click="
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view> $yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
<view class="v12-justify-between"> " v-if="orderInfo.isTickets!==1">查看物流
<view class="" style="position: relative">
<text class="btn-more v12-font-24 v12-mr-2" @click="showMore = !showMore">更多</text>
<view class="group-float" v-show="showMore" :style="{top: '-32px'}">
<view class="btn flex jc-center ai-center v12-font-24" @click="goGoodsReturn(orderInfo)">申请退款</view>
</view>
</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
<!-- <view class="bnt v12-dark-text v12-dark-border default" @click="
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
" v-if="orderInfo.isTickets!==1">查看物流
</view> -->
</view>
</view>
</template>
<template v-if="status.type == -1">
<view style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
</view>
</template>
<template v-if="status.type == -2">
<view class="v12-justify-between " style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
</view>
</template>
<template v-if="status.type == -3">
<view class="v12-justify-between " style="width: 100%">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
<view class="v12-justify-between ">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
</view>
</view> </view>
</template> </template>
<template v-if="status.type == 4"> <template v-if="status.type == 4">
<view class="bnt v12-dark-text v12-dark-border cancel" @click="delOrder">删除订单</view> <view class="bnt cancel" @click="delOrder">删除订单</view>
<view <view class="bnt default" @click="
v-if="orderInfo.isTickets !== 1" $yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
class="bnt v12-dark-text v12-dark-border default" " v-if="orderInfo.isTickets!==1">查看物流
@click="$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})"
>查看物流
</view> </view>
</template> </template>
<template v-if="status.type == 6"> <template v-if="status.type == 6">
<view class="bnt v12-primary-text v12-primary-border" @click="goGroupRule(orderInfo)">查看拼团</view> <view class="bnt bg-color-red" @click="goGroupRule(orderInfo)">查看拼团</view>
</template> </template>
</view> </view>
<u-modal :show="showExtend" title="确认延长收货时间?" content='每笔订单只能延长一次哦' showCancelButton
@cancel="showExtend=false" @confirm="doneDelay"></u-modal>
<Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment> <Payment v-model="pay" :types="payType" @checked="toPay" :balance="userInfo.nowMoney"></Payment>
<view class="geoPage" v-if="mapShow"> <view class="geoPage" v-if="mapShow">
<iframe width="100%" height="100%" frameborder="0" scrolling="no" <iframe width="100%" height="100%" frameborder="0" scrolling="no"
@@ -428,14 +257,12 @@
<script> <script>
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard' import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
import OrderGoods from "@/components/OrderGoods"; import OrderGoods from "@/components/OrderGoods";
import {orderDetail, orderDelay, aginConfirm, express, editAddress} from "@/api/order"; import {orderDetail} from "@/api/order";
import Payment from "@/components/Payment"; import Payment from "@/components/Payment";
import DataFormat from "@/components/DataFormat"; import DataFormat from "@/components/DataFormat";
import {copyClipboard} from "@/utils"; import {copyClipboard} from "@/utils";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order"; import {cancelOrderHandle, delOrderHandle, payOrderHandle, takeOrderHandle, yuePayOrderHandle} from "@/libs/order";
import { pageListenMixins } from '@/mixins/pageListenMixins'
// import {postCartAdd} from "@/api/store";
const STATUS = [ const STATUS = [
"待付款", "待付款",
@@ -459,13 +286,9 @@ export default {
DataFormat, DataFormat,
passkeyborad passkeyborad
}, },
mixins: [pageListenMixins], props: {},
data: function () { data: function () {
return { return {
addressId: null,
showExtend: false,
delayId: '',
showMore: false,
isShowPayPwdPop: false, isShowPayPwdPop: false,
offlinePayStatus: 2, offlinePayStatus: 2,
orderTypeName: "普通订单", orderTypeName: "普通订单",
@@ -483,9 +306,7 @@ export default {
mapKay: "", mapKay: "",
mapShow: false, mapShow: false,
payPassword: null, payPassword: null,
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL
pageKeyId: Object.freeze('userOrderInfo'),
logistics: {}
}; };
}, },
computed: { computed: {
@@ -497,46 +318,6 @@ export default {
onShow() { onShow() {
this.id = this.$yroute.query.id; this.id = this.$yroute.query.id;
this.getDetail(); this.getDetail();
uni.$on('chooseAddress', (res) => {
this.addressId = res.id
})
},
watch: {
addressId(val) {
if(val) {
const params = {
addressId: this.addressId,
orderId: this.orderInfo.orderId
}
setTimeout(() => {
uni.showModal({
title:'确定修改地址吗?',
content: '',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success:(success)=>{
if(success.confirm) {
uni.showLoading()
editAddress(params).then(res => {
uni.showToast({
icon: 'success',
title: '修改成功!'
})
this.getDetail();
}).finally(() => {
uni.hideLoading()
})
}
},
complete:(complete)=>{
uni.hideLoading()
this.addressId = ''
},
})
}, 1000)
}
}
}, },
// inject: ["app"], // inject: ["app"],
mounted: function () { mounted: function () {
@@ -544,115 +325,6 @@ export default {
}, },
methods: { methods: {
copyClipboard, copyClipboard,
handleBody() {
this.showMore = false
this.$forceUpdate()
},
getExpressInfo() {
let params = {
orderCode: this.orderInfo.id,
shipperCode: this.orderInfo.deliverySn,
logisticCode: this.orderInfo.deliveryId
};
express(params)
.then(res => {
const {success, data} = res
if(success) {
this.logistics = data || {}
}
})
.catch(err => {
// uni.showToast({
// title:
// err.msg || err.response.data.msg || err.response.data.message,
// icon: "none",
// duration: 2000
// });
});
},
goLogistics(order) {
this.$yrouter.push({
path: "/pages/order/Logistics/index",
query: {
id: order.orderId
}
});
},
buyAgin() {
const params = {
orderId: this.orderInfo.orderId
}
aginConfirm(params).then(res => {
const ids = res.data.cartInfo.map(e => e.id)
const addressInfo = res.data.addressInfo
if (ids.length === 0) return
uni.navigateTo({
url: '/pages/order/OrderSubmission/index?id=' + ids.join(',') + '&address=' + JSON.stringify(addressInfo)
})
})
},
goAddress() {
this.$yrouter.push({
path:'/pages/user/address/AddressManagement/index',
query: {
choosMode: 1
}
})
},
toDelay(id) {
this.delayId = id;
this.showExtend = true;
},
doneDelay() {
orderDelay(this.delayId).then(() => {
this.showExtend = false;
this.getDetail()
});
},
buyOrder() {
let q = {
productId: this,
cartNum: that.attr.productSelect.cart_num,
new: 1,
uniqueId: that.attr.productSelect !== undefined ?
that.attr.productSelect.unique : ""
};
const ids = this.orderInfo.cartId
if (ids.length === 0) return
uni.navigateTo({
url: '/pages/order/OrderSubmission/index?id=' + ids
})
},
routerGo(cart) {
this.$yrouter.push({
path: "/pages/shop/GoodsEvaluate/index",
query: { id: cart.unique }
});
},
goOrderDetails(order) {
this.$yrouter.push({
path: "/pages/order/OrderDetails/index",
query: {
id: order.orderId
}
});
},
goRoom(order) {
const params = {
goodsId: order.cartInfo[0].productId,
goodsName: order.cartInfo[0].productInfo.storeName,
skuStr: order.cartInfo[0].productInfo.attrInfo.sku,
price: order.cartInfo[0].productInfo.attrInfo.price,
seckillId: order.cartInfo[0].seckillId,
cover: order.cartInfo[0].productInfo.attrInfo.image,
goodsData: '',
seckillData: ''
}
uni.navigateTo({
url: `/pkg_common/views/room?id=${order.merId}&name=${order.merName}&params=${JSON.stringify(params)}`
})
},
force2Decimal(v) { force2Decimal(v) {
return this.$force2Decimal(v); return this.$force2Decimal(v);
}, },
@@ -682,7 +354,7 @@ export default {
status = "已退款"; status = "已退款";
break; break;
case -3: case -3:
status = "退款失败"; status = "已驳回";
break; break;
} }
return status; return status;
@@ -811,8 +483,8 @@ export default {
}, },
delOrder() { delOrder() {
delOrderHandle(this.orderInfo.orderId).then(() => { delOrderHandle(this.orderInfo.orderId).then(() => {
this.goBack() setTimeout(() => this.goBack(), 300);
}) });
}, },
setOfflinePayStatus: function (status) { setOfflinePayStatus: function (status) {
var that = this; var that = this;
@@ -886,9 +558,6 @@ export default {
this.system_store = res.data.systemStore || {}; this.system_store = res.data.systemStore || {};
this.mapKey = res.data.mapKay; this.mapKey = res.data.mapKay;
this.setOfflinePayStatus(this.orderInfo.offlinePayStatus); this.setOfflinePayStatus(this.orderInfo.offlinePayStatus);
if(this.orderInfo._status._type == 3 || (this.orderInfo._status._type == 2 && this.orderInfo.isTickets!==1)) {
this.getExpressInfo()
}
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
@@ -917,45 +586,6 @@ export default {
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.u-count-down__text{
color: #999 !important;
}
.footer{
height: 122rpx;
border-radius: 40rpx 40rpx 0rpx 0rpx;
}
.fails-bg{
padding:10rpx;
background: rgba(197,39,51,0.2);
border-radius: 8rpx;
color: #C52733 !important;
line-height: 34rpx
}
.group-float {
position: absolute;
width: 196rpx;
box-sizing: border-box;
box-shadow: 0 2px 16px rgba(0, 0, 0, 0.16);
padding: 0 20rpx;
background: #fff;
left: -40px;
right: 0;
top: -62px;
.btn {
box-sizing: border-box;
padding: 20rpx 0;
color: #333;
font-size: 32rpx;
line-height: 1;
}
.btn-service {
border-bottom: 1rpx solid #F0F0F0;
}
}
.bnt{
font-size: 28rpx !important;
}
.geoPage { .geoPage {
position: fixed; position: fixed;
width: 100%; width: 100%;
@@ -1122,8 +752,9 @@ export default {
/deep/ .pending-payments { /deep/ .pending-payments {
font-size: 26rpx; font-size: 26rpx;
letter-spacing: 1px;
.u-count-down__text { .u-count-down__text {
color: #FF5C5C;
font-size: 26rpx; font-size: 26rpx;
line-height: 1; line-height: 1;
} }
@@ -1137,9 +768,4 @@ export default {
color: #FE5261; color: #FE5261;
font-size: 26rpx; font-size: 26rpx;
} }
.item {
.conttent-left {
text-align: left !important;
}
}
</style> </style>
+128 -278
View File
@@ -3,26 +3,28 @@
<view class="allAddress" style="background-color: #f6f6f6;"> <view class="allAddress" style="background-color: #f6f6f6;">
<view <view
class="address acea-row v12-align-start" class="address acea-row row-middle"
style="flex-wrap: nowrap;margin: 0 0 30rpx 0;border-radius: 16rpx;" style="flex-wrap: nowrap;margin: 0 0 30rpx 0;border-radius: 16rpx;"
v-if="shipping_type === 0" v-if="shipping_type === 0"
@click="addressTap" @click="addressTap"
> >
<image style="flex-shrink: 0;width: 36rpx;height: 36rpx;margin-right: 20rpx;" <image style="flex-shrink: 0;width: 48rpx;height: 48rpx;margin-right: 20rpx;"
:src="webUrl+'/orderIcon/map.png'" mode=""></image> :src="webUrl+'/20230304135530688212.png'" mode=""></image>
<view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;"> <view class="acea-row row-between-wrapper" style="flex-wrap: nowrap;flex-grow: 1;">
<view class="addressCon" v-if="addressInfo.realName"> <view class="addressCon" v-if="addressInfo.realName">
<view class="more-t"> <view class="name">
{{ addressInfo.province }}{{ addressInfo.city }}{{ addressInfo.district }}{{ addressInfo.detail }} {{ addressInfo.realName }}
</view>
<view class="name v12-font-28 v12-mt-3">
<text>{{ addressInfo.realName }}</text>
<text class="phone">{{ addressInfo.phone }}</text> <text class="phone">{{ addressInfo.phone }}</text>
</view> </view>
<view>
{{ addressInfo.province }}{{ addressInfo.city }}{{ addressInfo.district }}{{ addressInfo.detail }}
</view>
</view> </view>
<view class="addressCon" v-else> <view class="addressCon" v-else>
<view class="setaddress">设置收货地址</view> <view class="setaddress">设置收货地址</view>
</view> </view>
<view class="iconfont icon-jiantou" style="flex-shrink: 0;"></view>
</view> </view>
</view> </view>
<div style="flex-wrap: nowrap;" class="address acea-row row-middle" v-else @click="showStoreList"> <div style="flex-wrap: nowrap;" class="address acea-row row-middle" v-else @click="showStoreList">
@@ -45,154 +47,70 @@
</div> </div>
</view> </view>
<OrderGoods :evaluate="0" :cartInfo="orderGroupInfo.cartInfo" title="商品信息"></OrderGoods> <OrderGoods :evaluate="0" :cartInfo="orderGroupInfo.cartInfo" title="商品列表"></OrderGoods>
<view class="wrapper" style="margin:0;border-radius:0 0 20rpx 20rpx"> <view class="wrapper" style="margin: 30rpx 0;border-radius: 16rpx;">
<view class="v12-pa-2 acea-row row-between-wrapper" style="flex-wrap: nowrap;" v-if="shipping_type === 0"> <view class="item acea-row row-between-wrapper" style="flex-wrap: nowrap;" v-if="shipping_type === 0">
<view class="acea-row row-middle" style="flex-wrap: nowrap;"> <view class="acea-row row-middle" style="flex-wrap: nowrap;">
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230820761721.png'" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230820761721.png'"
mode=""></image> --> mode=""></image>
<text class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">快递费用</text> <text class="">快递费用</text>
</view> </view>
<view class="discount v12-secondary-dark-text v12-font-24 " style="width: auto !important;"> <view class="discount" style="width: auto !important;">
{{ orderPrice.payPostage > 0 ? force2Decimal(orderPrice.payPostage) : "包邮" }} {{ orderPrice.payPostage > 0 ? force2Decimal(orderPrice.payPostage) : "免运费" }}
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view class="v12-pa-2 acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系人</view> <view>联系人</view>
<view class="discount"> <view class="discount">
<input class="v12-font-24" type="text" placeholder="请填写您的联系姓名" v-model="contacts"/> <input type="text" placeholder="请填写您的联系姓名" v-model="contacts"/>
</view> </view>
</view> </view>
<view class="v12-pa-2 acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx">联系电话</view> <view>联系电话</view>
<view class="discount"> <view class="discount">
<input type="text" placeholder="请填写您的联系电话" v-model="contactsTel"/> <input type="text" placeholder="请填写您的联系电话" v-model="contactsTel"/>
</view> </view>
</view> </view>
</view> </view>
<view class=" v12-pa-2 v12-justify-between " style="z-index: -1;"> <view class="item" style="z-index: -1">
<view class="v12-align-start"> <view class="acea-row row-middle">
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230836494421.png'" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230836494421.png'"
mode=""></image> --> mode=""></image>
<text class="v12-font-24 v12-secondary-dark-text v12-pr-3 v12-text-right" style="width: 140rpx;">备注</text> <text class="">备注信息150字以内)</text>
</view> </view>
<textarea v-model="mark" placeholder="建议与商家协商一致" class="mark v12-font-24 "></textarea> <textarea v-model="mark"></textarea>
</view> </view>
</view> </view>
<!-- v12 --> <view class="wrapper" style="margin: 30rpx 0;border-radius: 16rpx;">
<view class="v12-mt-3">
<view class="v12-white v12-pa-3 v12-radius-20" >
<view class="v12-justify-between v12-align-center v12-py-1" >
<view class="v12-font-24 v12-dark-text">商品总价</view>
<view class="v12-secondary-dark-text">
<text class="v12-font-22 "></text>
<text class="v12-font-28">{{ force2Decimal(orderPrice.totalPrice) }}</text>
</view>
</view>
<!-- <view class="v12-justify-between v12-align-center v12-py-1" >
<view class="v12-font-24 v12-dark-text">运费</view>
<view class="v12-secondary-dark-text">
<text class="v12-font-22 "></text>
<text class="v12-font-28">{{ force2Decimal(orderPrice.payPostage) }}</text>
</view>
</view> -->
<view class="v12-justify-between v12-align-center v12-py-1">
<view class="v12-font-24 v12-dark-text v12-align-center">
<text>优惠券</text>
<view class="v12-align-center v12-ml-1" v-if="couponTitle">
<view class="v12-primary-text v12-primary-border v12-font-22 v12-radius-6 v12-px-1"></view>
<view class="v12-primary-text v12-primary-border v12-font-22 v12-radius-6 v12-px-1">{{ couponTitle }}</view>
</view>
</view>
<view class="v12-justify-between v12-align-center">
<view class="v12-mr-2" @click="changeCoupons" v-if="couponList.usable.length !== 0">
<text class="v12-dark-text v12-font-24" >{{ couponList.usable.length === 0 ? '无' : '去选择' }}</text>
<text class="iconfont icon-jiantou v12-font-24 v12-dark-text"></text>
</view>
<view class="v12-secondary-dark-text">
<text class="v12-font-22 ">-</text>
<text class="v12-font-28">{{ force2Decimal(orderPrice.couponPrice) }}</text>
</view>
</view>
</view>
<view class="v12-justify-between v12-align-center v12-py-1">
<view class="v12-font-24 v12-dark-text">积分抵扣</view>
<view class="v12-secondary-dark-text v12-align-center ">
<!-- <view class="v12-mr-2">
<u-switch
v-model="usePointsCheck"
size="14"
@change="usePointsCheckChange"
/>
</view> -->
<view>
<text class="v12-font-22 ">-</text>
<text class="v12-font-28">{{ force2Decimal(orderPrice.deductionPrice) }}</text>
</view>
</view>
</view>
</view>
<!-- <view class="coupon-cell">
<view class="flex jc-between ai-center">
<view class="title">积分抵扣</view>
<view class="flex ai-center">
<u-switch
v-model="usePointsCheck"
size="20"
@change="usePointsCheckChange"
/>
</view>
</view>
<view v-if="usePointsCheck" class="flex jc-between ai-center points-cell">
<view>积分{{ orderPrice.usedPoints }}</view>
<view class="flex ai-center">
-{{ force2Decimal(orderPrice.deductionPrice) }}
</view>
</view>
</view> -->
<!-- <view class="coupon-cell flex jc-between ai-center" @click="changeCoupons">
<view class="title">优惠券</view>
<view class="flex ai-center">
<text style="color:#999999" v-if="couponList.usable.length===0"></text>
<view class="flex ai-center" v-else>
<text style="color:#FF564A">{{ couponIndex < 0 ? '去选择' : -couponList.usable[couponIndex].couponPrice }}
</text>
<view class="iconfont icon-jiantou" style="flex-shrink: 0;"></view>
</view>
</view>
</view> -->
</view>
<view class="wrapper" style="margin: 30rpx 0;border-radius: 20rpx;">
<view class="item"> <view class="item">
<!-- <view>支付方式</view> --> <!-- <view>支付方式</view> -->
<view class="acea-row row-left row-middle"> <view class="acea-row row-left row-middle">
<view class="acea-row row-middle" style="position: relative;"> <view class="acea-row row-middle" style="position: relative;">
<!-- <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230846995104.png'" <image style="width: 32rpx;height: 32rpx;margin-right: 12rpx;" :src="webUrl+'/20210807230846995104.png'"
mode=""></image> --> mode=""></image>
<text class="v12-dark-text v12-font-32 v12-font-bold">支付方式</text> <text class="pay-method-title">支付方式</text>
<!-- <text class="pink-dot"></text> --> <!-- <text class="pink-dot"></text> -->
</view> </view>
</view> </view>
<view class="list" style="margin-top: 0;"> <view class="list">
<view <view
class="payItem acea-row row-middle" class="payItem acea-row row-middle"
:class="active === 'weixin' ? 'on' : ''" :class="active === 'weixin' ? 'on' : ''"
v-show="isWeixin"
@click="payItem('weixin')" @click="payItem('weixin')"
style="flex-wrap: nowrap; margin-top: 0" v-show="isWeixin"
style="flex-wrap: nowrap;"
> >
<view class="name acea-row v12-font-24"> <view class="name acea-row">
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> --> <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>
<image style="flex-shrink: 0;width: 32rpx;height: 32rpx;margin-right: 10rpx;" :src="webUrl+'/orderIcon/微信支付.png'" mode=""></image>
微信支付 微信支付
</view> </view>
<view class="tip">微信快捷支付</view> <view class="tip">微信快捷支付</view>
<label class="radio"> <label class="radio">
<radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#C52733"/> <radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#FF0000"/>
<text></text> <text></text>
</label> </label>
</view> </view>
@@ -201,35 +119,33 @@
:class="active === 'weixin' ? 'on' : ''" :class="active === 'weixin' ? 'on' : ''"
@click="payItem('weixin')" @click="payItem('weixin')"
v-show="!isWeixin" v-show="!isWeixin"
style="flex-wrap: nowrap; margin-top: 20rpx" style="flex-wrap: nowrap;"
> >
<view class="name acea-row v12-font-24"> <view class="name acea-row ">
<!-- <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view> --> <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>
<image style="flex-shrink: 0;width: 32rpx;height: 32rpx;margin-right: 10rpx;" :src="webUrl+'/orderIcon/微信支付.png'" mode=""></image>
微信支付 微信支付
</view> </view>
<view class="tip"></view> <view class="tip"></view>
<label class="radio"> <label class="radio">
<radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#C52733"/> <radio style="transform: scale(0.7);" value="" :checked="active === 'weixin'" color="#FF0000"/>
<text></text> <text></text>
</label> </label>
</view> </view>
<view <view
class="payItem acea-row row-middle v12-justify-between" class="payItem acea-row row-middle"
:class="active === 'yue' ? 'on' : ''" :class="active === 'yue' ? 'on' : ''"
@click="payItem('yue')" @click="payItem('yue')"
style="flex-wrap: nowrap;" style="flex-wrap: nowrap;"
> >
<view class="name acea-row v12-font-24"> <view class="name acea-row ">
<!-- <view style="background-color: #007AFF;" class="iconfont icon-icon-test" <view style="background-color: #007AFF;" class="iconfont icon-icon-test"
:class="active === 'yue' ? 'bounceIn' : ''"></view> --> :class="active === 'yue' ? 'bounceIn' : ''"></view>
<image style="flex-shrink: 0;width: 32rpx;height: 32rpx;margin-right: 10rpx;" :src="webUrl+'/orderIcon/余额宝.png'" mode=""></image>
余额支付 余额支付
</view> </view>
<!-- <view class="tip">可用余额{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}</view> --> <view class="tip">可用余额{{ userInfo.nowMoney ? force2Decimal(userInfo.nowMoney) : 0.00 }}</view>
<label class="radio"> <label class="radio">
<radio style="transform: scale(0.7);" value="" :checked="active === 'yue'" color="#C52733"/> <radio style="transform: scale(0.7);" value="" :checked="active === 'yue'" color="#FF0000"/>
<text></text> <text></text>
</label> </label>
@@ -237,61 +153,64 @@
</view> </view>
</view> </view>
</view> </view>
<view class="moneyList" style="margin-bottom:30rpx;border-radius: 16rpx;">
<view class="item acea-row row-between-wrapper" v-if="orderPrice.totalPrice !== undefined">
<view>商品总价</view>
<view class="money">{{ force2Decimal(orderPrice.totalPrice) }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0">
<view>运费</view>
<view class="money">{{ force2Decimal(orderPrice.payPostage) }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0">
<view>优惠券抵扣</view>
<view class="money">-{{ force2Decimal(orderPrice.couponPrice) }}</view>
</view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.deductionPrice > 0">
<view>积分抵扣</view>
<view class="money">-{{ force2Decimal(orderPrice.deductionPrice) }}</view>
</view>
</view>
<view class="coupon-cell flex jc-between ai-center" @click="changeCoupons">
<view class="title">优惠券</view>
<view class="flex ai-center">
<text style="color:#999999" v-if="couponList.usable.length===0"></text>
<view class="flex ai-center" v-else>
<text style="color:#FF564A">{{ couponIndex < 0 ? '去选择' : -couponList.usable[couponIndex].couponPrice }}
</text>
<view class="iconfont icon-jiantou" style="flex-shrink: 0;"></view>
</view>
</view>
</view>
<!-- v9 优惠券开始 --> <!-- v9 优惠券开始 -->
<u-popup <u-popup :show="show" :round="10" mode="bottom" closeOnClickOverlay @close="changeCoupons">
:show="show" <CouponsPopup :two-list="couponList" @close="changeCoupons" v-if="couponList.usable"/>
:round="10"
mode="bottom"
close-on-click-overlay
@close="changeCoupons"
>
<CouponsPopup
v-if="couponList.usable.length > 0"
:two-list="couponList"
@change="changeCoupons"
:currentPrice="force2Decimal(orderPrice.totalPrice)"
@max="couponMax"
:show-tab="false"
/>
</u-popup> </u-popup>
<!-- v9 优惠券结束 --> <!-- v9 优惠券结束 -->
<view style="height:80rpx"></view> <view style="height:80rpx"></view>
<view class="footer v12-justify-end v12-px-3" style="height: 120rpx;"> <view class="footer acea-row row-between-wrapper" style="height: 80rpx;">
<view class="v12-align-center v12-px-4"> <view style="margin-left: 30rpx;">
<view class="v12-mr-2"> <text style="color: #000000;font-size: 24rpx;font-weight: bold;">合计:</text>
<view> <text class="" style="color: #FF564A;font-size: 28rpx;font-weight: bold;">{{
<text class="v12-font-28 v12-dark-text v12-mr-2">{{ total }}</text> force2Decimal(orderPrice.payPrice)
<text class="v12-font-28 v12-dark-text v12-mr-1">合计:</text> }}
<text class="v12-font-22 v12-primary-text v12-font-bold"></text> </text>
<text class="v12-font-36 v12-primary-text v12-font-bold">{{ force2Decimal(orderPrice.payPrice) }}</text>
</view>
<view class="v12-primary-text v12-font-22 v12-text-right">
<text>共减</text>
<text></text>
<text>{{ force2Decimal(orderPrice.totalDiscountPrice) }}</text>
</view>
</view>
<view class="v12-primary v12-white-text v12-radius-60 v12-px-3 v12-py-2 v12-font-bold" @click="subscribePay">立即付款</view>
</view> </view>
<view class="settlement acea-row row-middle row-center" @click="subscribePay">立即结算</view>
</view> </view>
<AddressWindow <AddressWindow
v-model="showAddress" @checked="changeAddress"
ref="mychild" @redirect="addressRedirect"
:checked="addressInfo.id" v-model="showAddress"
@checked="changeAddress" :checked="addressInfo.id"
@redirect="addressRedirect" ref="mychild"
/> ></AddressWindow>
<passkeyborad
ref='payPwdPop' <passkeyborad :money="orderPrice.payPrice" showMoney :show="isShowPayPwdPop" ref='payPwdPop' @close="pwdPopClose"
showMoney @finish="pwdPopFinish"></passkeyborad>
:money="orderPrice.payPrice"
:show="isShowPayPwdPop"
@close="pwdPopClose"
@finish="pwdPopFinish"
/>
</view> </view>
</template> </template>
@@ -306,7 +225,6 @@ import {isNullOrEmpty, isWeixin} from "@/utils";
import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue'; import blPaymentPasswordInput from '@/components/blPaymentPasswordInput.vue';
import uniPopup from '@/components/uni-popup/uni-popup.vue'; import uniPopup from '@/components/uni-popup/uni-popup.vue';
import CouponsPopup from "@/components/CouponsPopup.vue" import CouponsPopup from "@/components/CouponsPopup.vue"
import { pageListenMixins } from '@/mixins/pageListenMixins'
const NAME = "OrderSubmission", const NAME = "OrderSubmission",
_isWeixin = isWeixin(); _isWeixin = isWeixin();
@@ -320,7 +238,6 @@ export default {
passkeyborad, passkeyborad,
CouponsPopup CouponsPopup
}, },
mixins: [pageListenMixins],
props: {}, props: {},
data: function () { data: function () {
return { return {
@@ -355,24 +272,10 @@ export default {
lotteryRecordId:'', lotteryRecordId:'',
payPassword: null, payPassword: null,
// v9-2 // v9-2
couponList: { couponList: {},
unusable: [], couponId: 0,
usable: []
},
couponId: uni.getStorageSync('couponId') || 0,
couponIndex: -1, couponIndex: -1,
show: false, show: false
// 是否使用积分开关
usePointsCheck: false,
// 要使用的积分数量(传0为不使用积分,目前需求是默认使用最大可使用的积分,所以只要传大于0的数值都会变为自动使用最大可用积分)
usePointsNumber: 0,
// 订单是否可以使用积分
canUsePoints: false,
// 订单最大可使用积分数量
maxPoints: 0,
pageKeyId: Object.freeze('orderConfirm'),
total: 0,
couponTitle: ''
}; };
}, },
computed: mapGetters(["userInfo", "storeItems"]), computed: mapGetters(["userInfo", "storeItems"]),
@@ -396,6 +299,7 @@ export default {
//地址切换也要重新计算一下 //地址切换也要重新计算一下
that.computedPrice('onLoad chooseAddress'); that.computedPrice('onLoad chooseAddress');
}) })
console.log(that.$yroute);
if (that.$yroute.query.pinkid !== undefined) { if (that.$yroute.query.pinkid !== undefined) {
that.pinkId = that.$yroute.query.pinkid; that.pinkId = that.$yroute.query.pinkid;
} }
@@ -418,10 +322,6 @@ export default {
}, },
methods: { methods: {
isNullOrEmpty, isNullOrEmpty,
couponMax(e) {
this.couponTitle = e.couponTitle
this.couponId = uni.getStorageSync('couponId') || 0
},
showStoreList() { showStoreList() {
this.$store.commit("get_to", "orders"); this.$store.commit("get_to", "orders");
this.$yrouter.push({ this.$yrouter.push({
@@ -431,17 +331,13 @@ export default {
force2Decimal(value) { force2Decimal(value) {
return this.$force2Decimal(value); return this.$force2Decimal(value);
}, },
usePointsCheckChange(e) {
this.computedPrice()
},
// 计算订单金额
computedPrice(f) { computedPrice(f) {
console.log(f)
let shipping_type = this.shipping_type; let shipping_type = this.shipping_type;
postOrderComputed(this.orderGroupInfo.orderKey, { postOrderComputed(this.orderGroupInfo.orderKey, {
addressId: this.addressInfo.id, addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0, useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponId || 0, couponId: this.couponId || 0,
usePoints: this.usePointsCheck ? 1 : 0,
shipping_type: parseInt(shipping_type) + 1 shipping_type: parseInt(shipping_type) + 1
}).then(res => { }).then(res => {
const data = res.data; const data = res.data;
@@ -454,71 +350,39 @@ export default {
}); });
} else { } else {
this.orderPrice = data.result; this.orderPrice = data.result;
console.log(this.orderPrice);
if (this.usePointsCheck) {
this.usePointsNumber = data.result.usedPoints
} else {
this.usePointsNumber = 0
}
} }
}); });
}, },
getCartInfo() { getCartInfo() {
const _this = this var that = this;
if (!_this.cartid && !_this.lotteryRecordId) { // const cartIds = this.$yroute.query.id;
if (!that.cartid && !that.lotteryRecordId) {
uni.showToast({ uni.showToast({
title: "参数有误", title: "参数有误",
icon: "none", icon: "none",
duration: 2000 duration: 2000
}) });
return this.$yrouter.back() return this.$yrouter.back();
} }
postOrderConfirm(_this.cartid,_this.lotteryRecordId).then(res => { postOrderConfirm(that.cartid,that.lotteryRecordId)
const { data } = res .then(res => {
_this.offlinePayStatus = data.offline_pay_status that.offlinePayStatus = res.data.offline_pay_status;
_this.orderGroupInfo = data that.orderGroupInfo = res.data;
_this.deduction = data.deduction that.deduction = res.data.deduction;
_this.couponList = data.couponList that.couponList = res.data.couponList
if (_this.couponId > 0) { that.addressInfo = res.data.addressInfo || {};
_this.couponList['usable'].map((item, index) => { that.systemStore = res.data.systemStore || {};
if (item.id === _this.couponId) { that.storeSelfMention = res.data.storeSelfMention;
item.checked = true that.couponId = uni.getStorageSync('couponId') || 0
_this.couponIndex = index that.computedPrice()
} else {
item.checked = false
}
}) })
} else { .catch(err => {
uni.removeStorageSync('couponId') uni.showToast({
} title: err.msg,
_this.canUsePoints = data.canUsePoints icon: "none",
_this.maxPoints = data.maxPoints duration: 2000
// 如果允许使用积分,则默认开启 });
_this.total = data.cartInfo.map(i => i.cartNum).reduce((a, b) => { });
return a + b
}, 0)
if (data.canUsePoints) {
_this.usePointsCheck = true
_this.usePointsNumber = data.maxPoints
}
if(_this.$yroute.query.address !== undefined ) {
_this.addressInfo = JSON.parse(_this.$yroute.query.address) || {}
} else {
_this.addressInfo = data.addressInfo || {}
}
_this.systemStore = data.systemStore || {}
_this.storeSelfMention = data.storeSelfMention
_this.computedPrice()
}).catch(err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
})
})
}, },
addressTap: function () { addressTap: function () {
//改用跳转页面方式 //改用跳转页面方式
@@ -650,7 +514,6 @@ export default {
addressId: this.addressInfo.id, addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0, useIntegral: this.useIntegral ? 1 : 0,
couponId: this.couponId || 0, couponId: this.couponId || 0,
usePoints: this.usePointsNumber || 0,
payType: this.active, payType: this.active,
pinkId: this.pinkId, pinkId: this.pinkId,
seckillId: this.orderGroupInfo.seckill_id, seckillId: this.orderGroupInfo.seckill_id,
@@ -773,25 +636,16 @@ export default {
}); });
}, },
// v9-2 // v9-2
changeCoupons(item) { changeCoupons() {
if(!item) return
if (this.couponList.usable.length === 0) return if (this.couponList.usable.length === 0) return
this.show = !this.show this.show = !this.show
this.couponId = uni.getStorageSync('couponId') || 0 this.couponId = uni.getStorageSync('couponId') || 0
this.couponTitle = item.couponTitle
}, },
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.mark{
background: rgba(0,0,0,0.05);
height: 128rpx;
border-radius: 16rpx;
padding: 5px 10px
}
.pink-dot { .pink-dot {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
@@ -840,7 +694,6 @@ export default {
.order-submission .wrapper .item .list .payItem { .order-submission .wrapper .item .list .payItem {
border: none !important; border: none !important;
height: auto !important;
} }
.order-submission .wrapper .item .list .payItem.on { .order-submission .wrapper .item .list .payItem.on {
@@ -932,6 +785,7 @@ export default {
.order-submission .allAddress .address { .order-submission .allAddress .address {
width: 6.91 * 100rpx; width: 6.91 * 100rpx;
height: 1.5 * 100rpx;
margin: 0 auto; margin: 0 auto;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -952,8 +806,4 @@ export default {
background-color: #FFFFFF; background-color: #FFFFFF;
font-size: 24rpx; font-size: 24rpx;
} }
.points-cell {
padding: 20rpx 0 0 0;
color: #999;
}
</style> </style>
+1 -4
View File
@@ -48,14 +48,12 @@
<script> <script>
import {getOrderList} from "@/api/order"; import {getOrderList} from "@/api/order";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "ReturnList", name: "ReturnList",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -63,8 +61,7 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
loading: false, loading: false,
loaded: false, loaded: false
pageKeyId: Object.freeze('userOrderRefundList')
}; };
}, },
methods: { methods: {
+354
View File
@@ -0,0 +1,354 @@
<template>
<view class="order-details pos-order-details">
<view class="header acea-row row-middle">
<view class="state">{{ title }}</view>
<view class="data">
<view class="order-num">订单{{ orderInfo.orderId }}</view>
<view>
<text class="time">
<data-format :date="orderInfo.addTime"></data-format>
</text>
</view>
</view>
</view>
<view class="orderingUser acea-row row-middle">{{ orderInfo.nickname }}</view>
<view class="address">
<view class="name">
{{ orderInfo.realName}}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
<view class="pos-order-goods">
<view
class="goods acea-row row-between-wrapper"
v-for="(item, orderInfoIndex) in orderInfo.cartInfo"
:key="orderInfoIndex"
>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ item.productInfo.storeName }}</view>
<view class="attr">{{ item.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ item.productInfo.price }}</view>
<view class="num">x{{ item.cartNum }}</view>
<view class="y-money">{{ item.productInfo.otPrice ? item.productInfo.otPrice : 0 }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ orderInfo.totalNum }}件商品应支付
<text class="money">{{ orderInfo.payPrice }}</text>
( 邮费 ¥{{
orderInfo.payPostage
}}
)
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>订单编号</view>
<view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.orderId)"
>复制</text>
</view>
</view>
<view class="item acea-row row-between">
<view>下单时间</view>
<view class="conter">
<data-format :date="orderInfo.addTime"></data-format>
</view>
</view>
<view class="item acea-row row-between">
<view>支付状态</view>
<view class="conter">{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}</view>
</view>
<view class="item acea-row row-between">
<view>支付方式</view>
<view class="conter">{{ payType }}</view>
</view>
<view class="item acea-row row-between">
<view>买家留言</view>
<view class="conter">{{ orderInfo.mark }}</view>
</view>
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>支付金额</view>
<view class="conter">{{ orderInfo.totalPrice }}</view>
</view>
<view class="item acea-row row-between">
<view>优惠券抵扣</view>
<view class="conter">-{{ orderInfo.couponPrice }}</view>
</view>
<view class="actualPay acea-row row-right">
实付款
<text class="money font-color-red">{{ orderInfo.payPrice }}</text>
</view>
</view>
<view
class="wrapper"
v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2"
>
<view class="item acea-row row-between">
<view>配送方式</view>
<view class="conter" v-if="orderInfo.delivery_type === 'express'">快递</view>
<view class="conter" v-if="orderInfo.delivery_type === 'send'">送货</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递公司</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人</view>
<view class="conter">{{ orderInfo.delivery_name }}</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递单号</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人电话</view>
<view class="conter">
{{ orderInfo.delivery_id
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.delivery_id)"
>复制</text>
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="footer acea-row row-right row-middle">
<view class="more"></view>
<view class="bnt cancel" @click="modify(0)" v-if="types == 0">一键改价</view>
<view class="bnt cancel" @click="modify(0)" v-if="types == -1">立即退款</view>
<view
class="bnt cancel"
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay"
>确认付款</view>
<view class="bnt delivery" v-if="types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
</view>
<PriceChange
:change="change"
:orderInfo="orderInfo"
v-on:closechange="changeclose($event)"
v-on:savePrice="savePrice"
:status="status"
></PriceChange>
</view>
</template>
<script>
import PriceChange from "@/components/PriceChange";
import DataFormat from "@/components/DataFormat";
import {
getAdminOrderDetail,
setAdminOrderPrice,
setAdminOrderRemark,
setOfflinePay,
setOrderRefund
} from "@/api/admin";
import { required, num } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
import { copyClipboard } from "@/utils";
export default {
name: "AdminOrder",
components: {
PriceChange,
DataFormat
},
props: {},
data: function() {
return {
order: false,
change: false,
order_id: "",
orderInfo: {
_status: {}
},
status: "",
title: "",
payType: "",
types: ""
};
},
watch: {
"$yroute.query.oid": function(newVal) {
let that = this;
if (newVal != undefined) {
that.order_id = newVal;
that.getIndex();
}
}
},
mounted: function() {
this.order_id = this.$yroute.query.oid;
this.getIndex();
},
methods: {
goGoodsDeliver(orderInfo) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: { oid: orderInfo.orderId }
});
},
copyClipboard,
more: function() {
this.order = !this.order;
},
modify: function(status) {
this.change = true;
this.status = status;
},
changeclose: function(msg) {
this.change = msg;
},
getIndex: function() {
let that = this;
getAdminOrderDetail(that.order_id).then(
res => {
that.orderInfo = res.data;
that.types = res.data._status._type;
that.title = res.data._status._title;
that.payType = res.data._status._payType;
},
err => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
},
async savePrice(opt) {
let that = this,
data = {},
price = opt.price,
remark = opt.remark,
refund_price = opt.refund_price.toString();
data.orderId = that.orderInfo.orderId;
if (that.status == 0 && that.orderInfo.refundStatus === 0) {
try {
await this.$validator({
price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ price });
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = price;
setAdminOrderPrice(data).then(
function() {
that.change = false;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.getIndex();
},
function() {
that.change = false;
uni.showToast({
title: "改价失败",
icon: "none",
duration: 2000
});
}
);
} else if (that.status == 0 && that.orderInfo.refundStatus === 1) {
try {
await this.$validator({
refund_price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({ refund_price });
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = refund_price;
data.type = opt.type;
setOrderRefund(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
}
);
} else {
try {
await this.$validator({
remark: [required(required.message("备注"))]
}).validate({ remark });
} catch (e) {
return validatorDefaultCatch(e);
}
data.remark = remark;
setAdminOrderRemark(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
}
},
offlinePay: function() {
setOfflinePay({ order_id: this.orderInfo.order_id }).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.getIndex();
},
err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
+330
View File
@@ -0,0 +1,330 @@
<template>
<view class="pos-order-list" ref="container">
<view class="nav acea-row row-around row-middle">
<view class="item" :class="where.status == 0 ? 'on' : ''" @click="changeStatus(0)">待付款</view>
<view class="item" :class="where.status == 1 ? 'on' : ''" @click="changeStatus(1)">待发货</view>
<view class="item" :class="where.status == 2 ? 'on' : ''" @click="changeStatus(2)">待收货</view>
<view class="item" :class="where.status == 3 ? 'on' : ''" @click="changeStatus(3)">待评价</view>
<view class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">已完成</view>
<view class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">退款</view>
</view>
<view class="list">
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
<view class="order-num acea-row row-middle" @click="toDetail(item)">
<text>订单号{{ item.orderId }}</text>
<text class="time">
<text>下单时间</text>
<data-format :date="item.addTime"></data-format>
</text>
</view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
<view class="goods acea-row row-between-wrapper" @click="toDetail(item)">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="val.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ val.productInfo.storeName }}</view>
<view class="attr" v-if="val.productInfo.sku">{{ val.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ val.productInfo.price }}</view>
<view class="num">x{{ val.cartNum }}</view>
<view class="y-money">{{ val.productInfo.otPrice }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ item.totalNum }}件商品应支付
<text class="money">{{ item.payPrice }}</text>
( 邮费 ¥{{
item.totalPostage
}}
)
</view>
<view class="operation acea-row row-between-wrapper">
<view class="more">
<!-- <view class="iconfont icon-gengduo" @click="more(index)"></view>-->
<!-- <view class="order" v-show="current === index">-->
<!-- <view class="items">-->
<!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
<!-- </view>-->
<!-- <view class="arrow"></view>-->
<!-- </view>-->
</view>
<view class="acea-row row-middle">
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
<view class="bnt" v-if="where.status == 1" @click="goGoodsDeliver(item)">去发货</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
:status="status"></PriceChange>
</view>
</template>
<script>
import PriceChange from "@/components/PriceChange";
import Loading from "@/components/Loading";
import DataFormat from "@/components/DataFormat";
import {
getAdminOrderList,
setAdminOrderPrice,
setAdminOrderRemark,
setOfflinePay,
setOrderRefund
} from "@/api/admin";
import {
required,
num
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
export default {
name: "AdminOrderList",
components: {
PriceChange,
Loading,
DataFormat
},
props: {},
data: function() {
return {
current: "",
change: false,
types: 0,
where: {
page: 1,
limit: 5,
status: 0
},
list: [],
loaded: false,
loading: false,
orderInfo: {},
status: ""
};
},
watch: {
"$yroute.query.types": function(newVal) {
let that = this;
if (newVal != undefined) {
that.where.status = newVal;
that.init();
}
},
types: function() {
this.getIndex();
}
},
mounted: function() {
let that = this;
that.where.status = that.$yroute.query.types;
that.current = "";
that.getIndex();
},
onReachBottom() {
!this.loading && this.getIndex();
},
methods: {
goGoodsDeliver(item) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: {
oid: item.orderId
}
});
},
more: function(index) {
if (this.current === index) this.current = "";
else this.current = index;
},
modify: function(item, status) {
this.change = true;
this.orderInfo = item;
this.status = status;
},
changeclose: function(msg) {
this.change = msg;
},
async savePrice(opt) {
let that = this,
data = {},
price = opt.price.toString(),
refund_price = opt.refund_price.toString(),
refund_status = that.orderInfo.refundStatus,
remark = opt.remark;
data.orderId = that.orderInfo.orderId;
if (that.status == 0 && refund_status === 0) {
try {
await this.$validator({
price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({
price
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = price;
setAdminOrderPrice(data).then(
function() {
that.change = false;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.init();
},
function() {
that.change = false;
uni.showToast({
title: "改价失败",
icon: "none",
duration: 2000
});
}
);
} else if (that.status == 0 && refund_status === 1) {
try {
await this.$validator({
refund_price: [
required(required.message("金额")),
num(num.message("金额"))
]
}).validate({
refund_price
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.price = refund_price;
data.type = opt.type;
setOrderRefund(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
} else {
try {
await this.$validator({
remark: [required(required.message("备注"))]
}).validate({
remark
});
} catch (e) {
return validatorDefaultCatch(e);
}
data.remark = remark;
setAdminOrderRemark(data).then(
res => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
}
},
init: function() {
this.list = [];
this.where.page = 1;
this.loaded = false;
this.loading = false;
this.getIndex();
this.current = "";
},
getIndex: function() {
let that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getAdminOrderList(that.where).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.where.limit;
that.list.push.apply(that.list, res.data);
that.where.page = that.where.page + 1;
},
err => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
},
changeStatus: function(val) {
if (this.where.status != val) {
this.where.status = val;
this.init();
}
},
toDetail: function(item) {
this.$yrouter.push({
path: "/pages/orderAdmin/AdminOrder/index",
query: {
oid: item.orderId
}
});
},
offlinePay: function(item) {
setOfflinePay({
order_id: item.order_id
}).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.init();
},
error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
}
);
}
}
};
</script>
<style lang="less">
</style>
+231
View File
@@ -0,0 +1,231 @@
<template>
<view class="deliver-goods">
<header>
<view class="order-num acea-row row-between-wrapper">
<view class="num line1">订单号{{ delivery.orderId }}</view>
<view class="name line1">{{ delivery.nickname }}</view>
</view>
<view class="address">
<view class="name">
{{ delivery.realName }}
<text class="phone">{{ delivery.userPhone }}</text>
</view>
<view>{{ delivery.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
</header>
<view class="wrapper">
<view class="item acea-row row-between-wrapper">
<view>发货方式</view>
<view class="mode acea-row row-middle row-right">
<view
class="goods"
:class="active === typesIndex ? 'on' : ''"
v-for="(item, typesIndex) in types"
:key="typesIndex"
@click="changeType(item, typesIndex)"
>
{{ item.title }}
<text class="iconfont icon-xuanzhong2"></text>
</view>
</view>
</view>
<view class="list" v-show="active === 0">
<picker
mode="selector"
:range="logistics"
class="mode"
range-key="name"
@change="changeLog"
>
<view class="item acea-row row-between-wrapper">
<view>快递公司</view>
<input
type="text"
placeholder="填写快递公司"
disabled="disabled"
v-model="deliveryNames"
class="mode"
/>
<!-- <input type="text" placeholder="填写快递公司" v-model="deliveryName" class="mode" /> -->
</view>
</picker>
<view class="item acea-row row-between-wrapper">
<view>快递单号</view>
<input type="text" placeholder="填写快递单号" v-model="deliveryId" class="mode" />
</view>
</view>
<view class="list" v-show="active === 1">
<view class="item acea-row row-between-wrapper">
<view>送货人</view>
<input type="text" placeholder="填写送货人" v-model="deliveryName" class="mode" />
</view>
<view class="item acea-row row-between-wrapper">
<view>送货电话</view>
<input type="text" placeholder="填写送货电话" v-model="deliveryId" class="mode" />
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="confirm" @click="saveInfo">确认提交</view>
</view>
</template>
<script>
import { getAdminOrderDelivery, setAdminOrderDelivery } from "@/api/admin";
import { getLogistics } from "@/api/public";
import { required } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog";
export default {
name: "GoodsDeliver",
components: {},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
types: [
{
type: "express",
title: "发货"
}
// {
// type: "send",
// title: "送货"
// },
// {
// type: "fictitious",
// title: "无需发货"
// }
],
active: 0,
order_id: "",
delivery: [],
logistics: [],
delivery_type: "express",
deliveryName: "",
deliveryId: "",
deliveryNames: "请选择"
};
},
watch: {
"$yroute.query.oid": function(newVal) {
let that = this;
if (newVal != undefined) {
that.order_id = newVal;
that.getIndex();
}
}
},
mounted: function() {
this.order_id = this.$yroute.query.oid;
this.getIndex();
this.getLogistics();
},
methods: {
changeLog: function(value) {
this.deliveryNames = this.logistics[value.detail.value].name;
this.deliveryName = this.logistics[value.detail.value].id;
},
changeType: function(item, index) {
this.active = index;
this.delivery_type = item.type;
this.deliveryName = "";
this.deliveryId = "";
},
getIndex: function() {
let that = this;
getAdminOrderDelivery(that.order_id).then(
res => {
that.delivery = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
getLogistics: function() {
let that = this;
getLogistics().then(
res => {
console.log(res.data);
that.logistics = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
async saveInfo() {
let that = this,
delivery_type = that.delivery_type,
deliveryName = that.deliveryName.toString(),
deliveryId = that.deliveryId,
save = {};
console.log(deliveryName);
save.orderId = that.order_id;
save.deliveryType = that.delivery_type;
switch (delivery_type) {
case "express":
try {
await this.$validator({
deliveryName: [required(required.message("快递公司"))],
deliveryId: [required(required.message("快递单号"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
case "send":
try {
await this.$validator({
deliveryName: [required(required.message("发货人姓名"))],
deliveryId: [required(required.message("发货人电话"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
}
},
setInfo: function(item) {
let that = this;
console.log(item);
setAdminOrderDelivery(item)
.then(res => {
console.log(res);
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.$yrouter.go(-1);
})
.catch(err => {
console.log(err);
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
@@ -0,0 +1,184 @@
<template>
<view class="OrderCancellation">
<view class="header">
<image mode="aspectFit" :src="`${staticUrl}/writeOffBg.jpg`" @click="openQRCode" />
</view>
<view class="whiteBg">
<view class="input">
<input type="number" placeholder="0" v-model="verify_code" />
</view>
<view class="bnt" @click="storeCancellation">立即核销</view>
</view>
<view class="scan" v-if="iswechat">
<image :src="webUrl+'/20200729154546061002.gif'" @click="openQRCode" />
</view>
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
</view>
</template>
<script>
import WriteOff from "@/components/WriteOff";
import {
isWeixin
} from "@/utils";
// import { wechatEvevt } from "@/libs/wechat";
import {
orderVerific
} from "@/api/order";
const NAME = "OrderCancellation";
export default {
name: NAME,
components: {
WriteOff
},
props: {},
data: function() {
return {
staticUrl:this.$STATIC_RESOURCE_URL,
webUrl: VUE_APP_RESOURCES_URL,
iShidden: true,
iswechat: isWeixin(),
orderInfo: {},
verify_code: ""
};
},
mounted: function() {},
methods: {
cancel: function(res) {
this.iShidden = res;
},
confirm: function() {
orderVerific(this.verify_code, 1)
.then(res => {
this.iShidden = true;
this.verify_code = "";
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
storeCancellation: function() {
let ref = /[0-9]{12}/;
if (!this.verify_code) {
uni.showToast({
title: "请输入核销码",
icon: "none",
duration: 2000
});
return;
}
if (!ref.test(this.verify_code)) {
uni.showToast({
title: "请输入正确的核销码",
icon: "none",
duration: 2000
});
return;
}
uni.showLoading({
title: "查询中"
});
orderVerific(this.verify_code, 0)
.then(res => {
uni.hideLoading();
this.orderInfo = res.data;
this.iShidden = false;
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
})
.catch(error => {
uni.hideLoading();
uni.showToast({
title: error.msg ||
error.response.data.msg ||
error.response.data.message,
icon: "none",
duration: 2000
});
});
},
openQRCode: function() {
let that = this;
// 这里需要调用扫码功能
}
}
};
</script>
<style scoped lang="less">
.OrderCancellation .header {
width: 100%;
height: 3 * 100rpx;
background-size: 100% 100%;
image {
width: 100%;
height: 3 * 100rpx;
}
}
.OrderCancellation .whiteBg {
width: 6.9 * 100rpx;
background-color: #fff;
margin: -0.93 * 100rpx auto 0 auto;
padding-top: 0.8 * 100rpx;
padding-bottom: 30rpx;
z-index: 99;
position: relative;
border-radius: 0.06 * 100rpx 0.06 * 100rpx 0 0;
}
.OrderCancellation .whiteBg .input {
width: 5.8 * 100rpx;
margin: 0 auto;
border-bottom: 0.01 * 100rpx solid #eee;
}
.OrderCancellation .whiteBg .input input {
padding-bottom: 0.25 * 100rpx;
font-size: 0.6 * 100rpx;
height: auto;
color: #282828;
width: 100%;
text-align: center;
}
.OrderCancellation .whiteBg .bnt {
font-size: 0.32 * 100rpx;
color: #fff;
width: 5.8 * 100rpx;
height: 0.86 * 100rpx;
border-radius: 0.43 * 100rpx;
background-image: linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -webkit-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -moz-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
text-align: center;
line-height: 0.86 * 100rpx;
margin: 0.55 * 100rpx auto 0 auto;
}
.OrderCancellation .scan {
width: 3 * 100rpx;
height: 3 * 100rpx;
margin: 1.1 * 100rpx auto 0 auto;
}
.OrderCancellation .scan image {
width: 100%;
height: 100%;
display: block;
}
</style>
+167
View File
@@ -0,0 +1,167 @@
<template>
<view class="order-index" ref="container">
<image :src="webUrl+'/20230304202119869348.png'" mode="widthFix" class="image" />
<view class="header acea-row">
<view class="item" @click="goAdminOrderList(0)">
<view class="num">{{ census.orderCount.unpaidCount }}</view>
<view>待付款</view>
</view>
<view class="item" @click="goAdminOrderList(1)">
<view class="num">{{ census.orderCount.unshippedCount }}</view>
<view>待发货</view>
</view>
<view class="item" @click="goAdminOrderList(2)">
<view class="num">{{ census.orderCount.receivedCount }}</view>
<view>待收货</view>
</view>
<view class="item" @click="goAdminOrderList(3)">
<view class="num">{{ census.orderCount.evaluatedCount }}</view>
<view>待评价</view>
</view>
<view class="item" @click="goAdminOrderList(4)">
<view class="num">{{ census.orderCount.refundCount }}</view>
<view>退款</view>
</view>
</view>
<view class="wrapper">
<view class="title">
<text class="iconfont icon-shujutongji"></text>数据统计
</view>
<view class="list acea-row">
<view class="item" @click="goStatistics({type:'price',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayPrice }}</view>
<view>今日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proPrice }}</view>
<view>昨日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthPrice }}</view>
<view>本月成交额</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayCount }}</view>
<view>今日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proCount }}</view>
<view>昨日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthCount }}</view>
<view>本月订单数</view>
</view>
</view>
</view>
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单数</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, orderListIndex) in list"
:key="orderListIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import { getStatisticsInfo, getStatisticsMonth } from "@/api/admin";
import Loading from "@/components/Loading";
export default {
name: "OrderIndex",
components: {
Loading
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
census: {
orderCount: {},
orderTimeCount: {}
},
list: [],
where: {
page: 1,
limit: 15
},
loaded: false,
loading: false
};
},
mounted: function() {
this.getIndex();
this.getList();
},
onReachBottom() {
!this.loading && this.getList();
},
methods: {
goStatistics(query) {
this.$yrouter.push({
path: "/pages/orderAdmin/Statistics/index",
query
});
},
goAdminOrderList(types) {
this.$yrouter.push({
path: "/pages/orderAdmin/AdminOrderList/index",
query: { types }
});
},
getIndex: function() {
var that = this;
getStatisticsInfo().then(
res => {
that.census = res.data;
that.census.unpaidCount = that.census.orderCount.unpaidCount;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
},
getList: function() {
var that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getStatisticsMonth(that.where).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.where.limit;
that.list.push.apply(that.list, res.data);
that.where.page = that.where.page + 1;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
},
300
);
}
}
};
</script>
+446
View File
@@ -0,0 +1,446 @@
<template>
<view class="statistical-page" ref="container">
<view class="navs">
<view class="list">
<view class="item" :class="time == 'today' ? 'on' : ''" @click="setTime('today')">今天</view>
<view class="item" :class="time == 'yesterday' ? 'on' : ''" @click="setTime('yesterday')">昨天</view>
<view class="item" :class="time == 'seven' ? 'on' : ''" @click="setTime('seven')">最近7天</view>
<view class="item" :class="time == 'month' ? 'on' : ''" @click="setTime('month')">本月</view>
</view>
</view>
<view class="wrapper">
<view class="title">{{ title }}{{ this.where.type == 1 ? "营业额(元)" : "订单量(份)" }}</view>
<view class="money">{{ time_price }}</view>
</view>
<!-- <view class="chart">
<view class="company">{{ where.type === 1 ? "单位(元)" : "单位(份)" }}</view>
<ECharts :options="polar"></ECharts>
</view>-->
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单量</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, statisticalIndex) in list"
:key="statisticalIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<!-- <view class="calendar-wrapper" :class="current === true ? 'on' : ''">
<view class="calendar">
<Calendar
:clean="clean"
:lunar="lunar"
ref="calendar"
:range="isrange"
:multi="ismulti"
@select="select"
@next="next"
@prev="prev"
:value="value"
:weekSwitch="weekSwitch"
:monthRange="monthRange"
rangeMonthFormat="yyyy年MM月"
monFirst
responsive
:begin="[1992, 5, 20]"
:end="[2049, 5, 20]"
/>
</view>
</view>-->
<view class="mask" @touchmove.prevent v-show="current === true" @click="close"></view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
// import ECharts from "vue-echarts";
// import "echarts/lib/chart/line";
// import "echarts/lib/component/polar";
// import Calendar from "mpvue-calendar";
// import "mpvue-calendar/src/browser-style.css";
import { getStatisticsMonth, getStatisticsTime } from "@/api/admin";
import Loading from "@/components/Loading";
const year = new Date().getFullYear();
const month = new Date().getMonth() + 1;
const day = new Date().getDate();
export default {
name: "Statistics",
components: {
// ECharts,
// Calendar,
Loading
},
props: {},
data: function() {
return {
polar: {
tooltip: {
trigger: "axis"
},
legend: {
data: [""]
},
toolbox: {
show: false,
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ["line"] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
xAxis: [
{
type: "category",
boundaryGap: false,
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: "#999",
width: 1 //这里是为了突出显示加上的
}
}
}
],
yAxis: [
{
type: "value",
splitLine: {
show: true,
lineStyle: {
color: ["#f5f5f5"],
width: 1,
type: "solid"
}
},
axisLine: {
lineStyle: {
color: "#999",
width: 1 //这里是为了突出显示加上的
}
}
}
],
series: [
{
name: "邮件营销",
type: "line",
stack: "总量",
itemStyle: {
normal: {
color: "#2291f8", //折点颜色
lineStyle: {
color: "#2291f8" //折线颜色
}
}
},
data: [120, 132.5, 101, 134, 90, 150, 30]
}
],
grid: {
x: 30,
x2: 10,
y: 20,
y2: 110
},
animationDuration: 2000
},
value: [
[year, month, day - 1],
[year, month, day]
],
isrange: true,
weekSwitch: false,
ismulti: false,
monFirst: true,
clean: false, //简洁模式
lunar: false, //显示农历
renderValues: [],
monthRange: [],
current: false,
where: {
start: "",
stop: "",
type: "",
cate: 1
},
types: "", //类型|order=订单数|price=营业额
time: "", //时间|today=今天|yesterday=昨天|month=本月
title: "", //时间|today=今天|yesterday=昨天|month=本月
growth_rate: "", //增长率
increase_time: "", //增长率
increase_time_status: "", //增长率
time_price: "", //增长率
loaded: false,
loading: false,
filter: {
page: 1,
limit: 10
},
list: []
};
},
watch: {
"$yroute.params": function(newVal) {
var that = this;
if (newVal != undefined) {
that.setType(newVal.type);
that.setTime(newVal.time);
that.getIndex();
}
}
},
mounted: function() {
this.handelRenderValues();
this.setTime(this.$yroute.query.time);
this.setType(this.$yroute.query.type);
// this.getIndex();
this.getInfo();
},
onReachBottom() {
!this.loading && this.getInfo();
},
computed: {
monthRangeText() {
return this.monthRange.length ? "固定" : "指定范围";
}
},
methods: {
getIndex: function() {
var that = this;
getStatisticsTime(that.where).then(
res => {
var _info = res.data.chart,
day = [],
num = [];
_info.forEach(function(item) {
day.push(item.time);
num.push(item.num);
});
that.polar.xAxis[0].data = day;
that.polar.series[0].data = num;
that.growth_rate = res.data.growth_rate;
that.increase_time = res.data.increase_time;
that.increase_time_status = res.data.increase_time_status;
that.time_price = res.data.time;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
setTime: function(time) {
this.time = time;
var year = new Date().getFullYear(),
month = new Date().getMonth() + 1,
day = new Date().getDate();
switch (time) {
case "today":
this.where.cate = 1;
this.title = "今日";
this.getIndex();
break;
case "yesterday":
this.where.cate = 2;
this.title = "昨日";
this.getIndex();
break;
case "month":
this.where.cate = 4;
this.title = "本月";
this.getIndex();
break;
case "seven":
this.where.cate = 3;
this.title = "七日";
this.getIndex();
break;
}
},
setType: function(type) {
switch (type) {
case "price":
this.where.type = 1;
break;
case "order":
this.where.type = 2;
break;
}
},
clickSomeThing(data) {
this.value = [
[2019, 4, 1],
[2019, 4, 8]
];
},
setMonthRange() {
this.monthRange = this.monthRange.length ? [] : ["2019-4", "2020-1"];
},
switchMode() {
this.weekSwitch = !this.weekSwitch;
setTimeout(() => {
// this.$refs.calendar.renderer(2019, 1); //渲染2018年8月份
}, 0);
},
handelRenderValues(data) {
if (this.ismulti) {
this.renderValues = this.value.map(v => v.join("-"));
} else if (this.isrange) {
const values = [];
data || this.value;
this.value.forEach((v, i) => {
values.push(v.join("-"));
if (!i) {
values.push("~");
}
});
this.renderValues = values;
} else {
this.renderValues = [this.value.join("-")];
}
},
multiMode() {
this.ismulti = true;
this.isrange = false;
this.value = [
[year, month, 16],
[year, month, 18]
];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
rangeMode() {
this.ismulti = false;
this.isrange = true;
this.value = [
[year, month, 16],
[year, month, 22]
];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
valueMode() {
this.ismulti = false;
this.isrange = false;
this.value = [year, month, 16];
this.handelRenderValues();
// this.$refs.calendar.renderer(year, month);
},
selectMonth(month, year) {},
prev(y, m, w) {},
next(year, month, week) {},
selectYear(year) {},
setToday() {
// this.$refs.calendar.setToday();
},
dateInfo() {
// const info = this.$refs.calendar.dateInfo(2018, 8, 23);
},
renderer() {
if (this.monthRange.length) {
this.monthRange = ["2018-8", "2018-8"];
}
// this.$refs.calendar.renderer(2018, 8); //渲染2018年8月份
},
select(val, val2) {
if (this.isrange) {
this.handelRenderValues([val, val2]);
} else if (this.ismulti) {
this.handelRenderValues(val);
} else {
this.handelRenderValues([val]);
}
if (
this.where.start != new Date(val) / 1000 ||
this.where.stop != new Date(val2) / 1000 + 24 * 60 * 60 - 1
) {
this.time = "date";
this.title = "";
this.where.start =
new Date(Date.parse(val[0] + "/" + val[1] + "/" + val[2])).getTime() /
1000;
this.where.stop =
new Date(
Date.parse(val2[0] + "/" + val2[1] + "/" + val2[2])
).getTime() /
1000 +
24 * 60 * 60 -
1;
this.getIndex();
}
},
dateTitle: function() {
this.current = true;
},
close: function() {
this.current = false;
},
getInfo: function() {
var that = this;
if (that.loading || that.loaded) return;
that.loading = true;
getStatisticsMonth(that.filter).then(
res => {
that.loading = false;
that.loaded = res.data.length < that.filter.limit;
// that.list.push.apply(that.list, res.data);
that.list = res.data;
that.filter.page = that.filter.page + 1;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
<style scoped lang="less">
.echarts {
width: 100%;
height: 5.5 * 100rpx;
}
.calendar-wrapper {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 66;
transform: translate3d(0, 100%, 0);
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.calendar-wrapper.on {
transform: translate3d(0, 0, 0);
}
.statistical-page .wrapper .increase {
font-size: 0.26 * 100rpx;
}
.statistical-page .wrapper .increase .iconfont {
margin-left: 0;
}
</style>
+5 -34
View File
@@ -5,9 +5,8 @@
<input <input
v-model.trim="search" v-model.trim="search"
type="text" type="text"
placeholder="请输入" placeholder="搜索商品"
placeholder-style="color:#999" placeholder-style="color:#999"
@confirm="submit"
/> />
<view class="btn flex-0 flex jc-center ai-center" @click="submit"> <view class="btn flex-0 flex jc-center ai-center" @click="submit">
<text class="iconfont icon-sousuo2"></text> <text class="iconfont icon-sousuo2"></text>
@@ -16,17 +15,7 @@
</view> </view>
</view> </view>
<view v-if="historyKey.length" class="page-content"> <view v-if="historyKey.length" class="page-content">
<view <view class="title">历史搜索</view>
class="title"
>
历史搜索
<u-icon
name="trash-fill"
color="#aaa"
size="20"
@click="deleteHistoryHandle"
/>
</view>
<view class="list acea-row limit-box"> <view class="list acea-row limit-box">
<view <view
v-for="item of historyKey" v-for="item of historyKey"
@@ -70,10 +59,10 @@ export default {
} }
}, },
mounted: function () { mounted: function () {
this.getData() this.getData();
}, },
onShow() { onShow() {
this.getHistory() this.getHistory();
}, },
methods: { methods: {
submit() { submit() {
@@ -103,25 +92,9 @@ export default {
} }
this.historyKey.unshift({id: this.$global.generateMixed(10), word }) this.historyKey.unshift({id: this.$global.generateMixed(10), word })
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey)) uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
},
deleteHistoryHandle() {
const _this = this
uni.showModal({
title: '确认删除最近的搜索记录吗?',
content: '',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: (result) => {
if (result.confirm) {
_this.historyKey = []
uni.setStorageSync('historyKey', JSON.stringify([]))
}
}
})
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
@@ -166,8 +139,6 @@ export default {
padding: 0 32rpx; padding: 0 32rpx;
.title { .title {
display: flex;
justify-content: space-between;
margin: 22rpx 0 24rpx; margin: 22rpx 0 24rpx;
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
+21
View File
@@ -263,6 +263,15 @@
goGoodSearch() { goGoodSearch() {
this.$yrouter.push("/pages/shop/GoodSearch/index"); this.$yrouter.push("/pages/shop/GoodSearch/index");
}, },
goGoodsList(child) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: {
id: child.id,
title: child.cateName
}
});
},
activeCateId(n) { activeCateId(n) {
let index = 0; let index = 0;
n = parseInt(n); n = parseInt(n);
@@ -305,6 +314,18 @@
}); });
}); });
}, },
submitForm: function() {
var val = trim(this.search);
if (val) {
this.$yrouter.push({
path: "/pages/shop/GoodsList/index",
query: {
s: val
}
});
setTimeout(() => (this.search = ""), 500);
}
},
asideTap(index) { asideTap(index) {
this.navActive = index; this.navActive = index;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-58
View File
@@ -1,58 +0,0 @@
<template>
<view class="v12-px-3 v12-py-5 qua-card ">
<view class="v12-white v12-radius-16">
<view class="v12-justify-between v12-pa-3">
<text class="v12-font-32 v12-dark-text">
商家名称
</text>
<text class="v12-font-32 v12-dark-text v12-font-bold">
{{ merInfo.name }}
</text>
</view>
<view class="v12-my-3 v12-justify-center v12-pb-3" v-for="(item , i) in merInfo.qualifications" :key="i">
<image @tap="previewImage(i)" class="img" :src="item.image" :data-src="item.image" mode="widthFix" lazy-load="true" v-if="more || i === 0"></image>
</view>
<view class="v12-align-center v12-justify-center v12-font-24 v12-pb-3" @click="showMore" v-if="!more && merInfo.qualifications.length > 1">
<text class="v12-dark1-text">查看更多</text>
<u-icon name="arrow-down"></u-icon>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
merInfo: {
qualifications: []
},
more: false
}
},
onLoad(opts) {
this.merInfo = JSON.parse(opts.mer)
},
methods: {
previewImage (i) {
uni.previewImage({
current: i,
urls: this.merInfo.qualifications
})
},
showMore() {
this.more = !this.more
}
}
}
</script>
<style lang="less">
.qua-card {
}
.img{
width: 662rpx;
height: 360rpx;
border-radius: 16rpx;
}
</style>
+146 -135
View File
@@ -1,9 +1,6 @@
<template> <template>
<view class="evaluate-con"> <view class="evaluate-con">
<view <view class="goodsStyle acea-row row-between" v-if="orderCon.productInfo">
v-if="orderCon.productInfo"
class="goodsStyle acea-row row-between"
>
<view class="pictrue"> <view class="pictrue">
<image :src="orderCon.productInfo.image" class="image"/> <image :src="orderCon.productInfo.image" class="image"/>
</view> </view>
@@ -17,86 +14,77 @@
</view> </view>
<view class="score"> <view class="score">
<view <view
v-for="(item, scoreListIndexw) in scoreList" class="item acea-row row-middle"
:key="scoreListIndexw" v-for="(item, scoreListIndexw) in scoreList"
class="item acea-row row-middle" :key="scoreListIndexw"
> >
<view>{{ item.name }}</view> <view>{{ item.name }}</view>
<view class="starsList"> <view class="starsList">
<text <text
v-for="(itemn, starsIndexn) in item.stars" @click="stars(starsIndexn, scoreListIndexw)"
:key="starsIndexn" v-for="(itemn, starsIndexn) in item.stars"
:class="item.index >= starsIndexn ? 'icon-shitixing font-color-red' : 'icon-kongxinxing'" :key="starsIndexn"
class="iconfont" class="iconfont"
@click="stars(starsIndexn, scoreListIndexw)" :class="item.index >= starsIndexn ? 'icon-shitixing font-color-red': 'icon-kongxinxing'"
/> ></text>
</view> </view>
<text class="evaluate">{{ item.index === -1 ? "" : item.index + 1 + "分" }}</text> <text class="evaluate">{{ item.index === -1 ? "" : item.index + 1 + "分" }}</text>
</view> </view>
<view class="textarea"> <view class="textarea">
<textarea <textarea placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" v-model="expect"></textarea>
v-model="expect"
placeholder="商品满足你的期待么?说说你的想法,分享给想买的他们吧~" <u-upload
/> :fileList="uploadPictures"
<view class="upload-title"> @afterRead="afterRead"
添加视频/图片 @delete="deletePic"
<text class="txt"> name="uploadPictures"
({{ videoArr.length + picArr.length }}/9) multiple
</text> :maxCount="9"
</view> ></u-upload>
<view class="upload-wrapper"> <!-- <view class="list acea-row row-middle">-->
<view v-show="picArr.length < 9" class="video-upload"> <!-- <view-->
<tm-upload <!-- class="pictrue"-->
:upload_img_wh="uploadImgWH" <!-- v-for="(item, uploadPicturesIndex) in uploadPictures"-->
:upload_max="1" <!-- :key="uploadPicturesIndex"-->
:upload_count="1" <!-- >-->
:url="uploadUrl" <!-- <image :src="item"/>-->
:header="uploadHeader" <!-- <text-->
type='video' <!-- class="iconfont icon-guanbi1 font-color-red"-->
@change="uploadedVideoChange" <!-- @click="uploadPictures.splice(uploadPicturesIndex, 1)"-->
/> <!-- ></text>-->
</view> <!-- </view>-->
<view class="pic-upload"> <!-- <view class="pictrue uploadBnt acea-row row-center-wrapper row-column" @tap="chooseImage">-->
<tm-upload <!-- <text class="iconfont icon-icon25201"></text>-->
:upload_img_wh="uploadImgWH" <!-- <view>上传图片</view>-->
:upload_max="9 - videoArr.length" <!-- </view>-->
:upload_count="9 - videoArr.length" <!-- </view>-->
:url="uploadUrl"
:header="uploadHeader"
:showBlankPlaceholder="picArr.length !== 9"
type='image'
@change="uploadedPicChange"
/>
</view>
</view>
</view> </view>
<view class="evaluateBnt bg-color-red" @click="submit">立即评价</view> <view class="evaluateBnt bg-color-red" @click="submit">立即评价</view>
</view> </view>
</view> </view>
</template> </template>
<style scoped lang="less">
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
</style>
<script> <script>
import { postOrderComment, postOrderProduct } from '@/api/store' import {postOrderComment, postOrderProduct} from "@/api/store";
import { trim } from '@/utils' import {trim, uploadImage} from "@/utils";
import { required } from '@/utils/validate' import {required} from "@/utils/validate";
import { validatorDefaultCatch } from '@/utils/dialog' import {validatorDefaultCatch} from "@/utils/dialog";
import tmUpload from '@/components/tm-upload/tm-upload.vue'
import { const NAME = "GoodsEvaluate";
VUE_APP_API_URL
} from '@/config'
export default { export default {
name: 'GoodsEvaluate', name: NAME,
components: { components: {
tmUpload // VueCoreImageUpload
}, },
props: {}, props: {},
data: function () { data: function () {
return { return {
uploadUrl: VUE_APP_API_URL + '/api/upload',
uploadImgWH: (750 - 3 * 16 - 2 * 32 - 16) / 3.0,
uploadHeader: {
Authorization: "Bearer " + this.$store.getters.token
},
orderCon: { orderCon: {
cartProduct: { cartProduct: {
productInfo: {} productInfo: {}
@@ -104,113 +92,136 @@ export default {
}, },
scoreList: [ scoreList: [
{ {
name: '商品质量', name: "商品质量",
stars: ['', '', '', '', ''], stars: ["", "", "", "", ""],
index: -1 index: -1
}, },
{ {
name: '服务态度', name: "服务态度",
stars: ['', '', '', '', ''], stars: ["", "", "", "", ""],
index: -1 index: -1
} }
], ],
uploadPictures: [], uploadPictures: [],
expect: '', expect: "",
unique: '', unique: ""
picArr: [], };
videoArr: [] },
mounted: function () {
this.unique = this.$yroute.query.id;
this.getOrderProduct();
},
watch: {
$yroute(n) {
if (n.name === NAME && this.unique !== n.params.id) {
this.unique = n.params.id;
this.$set(this.scoreList[0], "index", -1);
this.$set(this.scoreList[1], "index", -1);
this.expect = "";
this.uploadPictures = [];
this.getOrderProduct();
}
} }
}, },
mounted() {
this.unique = this.$yroute.query.id
this.getOrderProduct()
},
methods: { methods: {
getOrderProduct() { getOrderProduct: function () {
postOrderProduct(this.unique).then(res => { let that = this,
this.orderCon = res.data unique = that.unique;
}) postOrderProduct(unique).then(res => {
that.orderCon = res.data;
});
}, },
stars: function (indexn, indexw) { stars: function (indexn, indexw) {
this.scoreList[indexw].index = indexn this.scoreList[indexw].index = indexn;
}, },
uploadedVideoChange(uploadList) { // chooseImage() {
this.videoArr = uploadList // chooseImage(img => {
// this.uploadPictures.push(img);
// });
// },
// 删除图片
deletePic(event) {
this[`${event.name}`].splice(event.index, 1)
}, },
uploadedPicChange(uploadList) {
this.picArr = uploadList afterRead(event) {
let that = this;
if (event.file.length > 0) {
event.file.map(item => {
uploadImage(item.url, img => {
that.uploadPictures.push({url: img})
})
})
}
}, },
async submit() { async submit() {
const expect = trim(this.expect) const expect = trim(this.expect),
const product_score = this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1 product_score =
const service_score = this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1 this.scoreList[0].index + 1 === 0 ? "" : this.scoreList[0].index + 1,
service_score =
this.scoreList[1].index + 1 === 0 ? "" : this.scoreList[1].index + 1;
try { try {
await this.$validator({ await this.$validator({
product_score: [ product_score: [
required('请选择商品质量分数', { required("请选择商品质量分数", {
type: 'number' type: "number"
}) })
], ],
service_score: [ service_score: [
required('请选择服务态度分数', { required("请选择服务态度分数", {
type: 'number' type: "number"
}) })
] ]
}).validate({ }).validate({
product_score, product_score,
service_score service_score
}) });
} catch (e) { } catch (e) {
return validatorDefaultCatch(e) return validatorDefaultCatch(e);
} }
let temp = this.uploadPictures.map(item => item.url)
let pics = temp.join(",")
postOrderComment({ postOrderComment({
productScore: product_score, productScore: product_score,
serviceScore: service_score, serviceScore: service_score,
unique: this.unique, unique: this.unique,
pics: this.picArr.join(','), pics,
comment: expect, comment: expect
video: this.videoArr.join(',')
}).then(() => {
uni.showToast({
title: '评价成功',
icon: 'success',
duration: 2000
})
this.$yrouter.back()
}).catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000
})
}) })
.then(() => {
uni.showToast({
title: "评价成功",
icon: "success",
duration: 2000
});
// ? 回跳到上一页
this.$yrouter.back();
// ? 默认跳转到详情页
// this.$yrouter.push({
// path: "/pages/order/OrderDetails/index",
// query: {
// id: this.orderCon.orderId
// }
// });
// ? 可选重定向到详情页,这时左上角会有一个返回首页的图标
// this.$yrouter.reLaunch({
// path: "/pages/home/index",
// });
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
} }
} }
}; };
</script> </script>
<style scoped lang="less">
.upload-title {
padding: 0 0 20rpx 16rpx;
.txt {
color: #999;
font-size: 22rpx;
}
}
.upload-wrapper {
position: relative;
padding: 0 0 0 16rpx;
.video-upload {
position: absolute;
top: 0;
left: 16rpx;
z-index: 5;
}
.pic-upload {
position: relative;
z-index: 2;
}
}
.evaluate-con .score .textarea .list .pictrue.uploadBnt {
border: 1px solid #ddd;
}
</style>
+277 -442
View File
@@ -1,322 +1,309 @@
<template> <template>
<view class="productList"> <view class="productList" ref="container">
<form @submit.prevent="submitForm"> <form @submit.prevent="submitForm">
<view class="search search-wrap acea-row row-between-wrapper"> <view class="search bg-color-red acea-row row-between-wrapper">
<view class="input acea-row row-between-wrapper"> <view class="input acea-row row-between-wrapper">
<view class="search-type-wrap" @click="toggleSearchType(true)"> <text class="iconfont icon-sousuo"></text>
{{ searchType === 'good' ? '商品' : '店铺' }} <input placeholder="搜索商品信息" v-model="where.keyword" confirm-type="search" @confirm="submitForm"/>
<text class="d3"></text>
</view>
<input
v-model="query.keyword"
placeholder="请输入"
confirm-type="search"
class="inp"
@confirm="submitForm"
/>
<text class="iconfont icon-sousuo" @click="submitForm"></text>
</view> </view>
<view
class="iconfont"
:class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'"
@click="switchTap"
></view>
</view> </view>
</form> </form>
<view v-if="showSearchTypeLayer" class="search-type-layer"> <view class="nav acea-row row-middle">
<view class="layer" @click="toggleSearchType(false)" />
<view class="content">
<view
v-for="(item, index) in searchTypeList"
:key="index"
:class="item.value === searchType ? 'on' : ''"
class="item"
@click="searchTypeItemClick(item)"
>
{{ item.text }}
</view>
</view>
</view>
<view
v-if="searchType === 'good'"
class="nav acea-row row-middle"
>
<view class="item">
<text class="tag">
综合
</text>
</view>
<view class="item" @click="setQuery('priceOrder')">
价格
<image v-if="!query.priceOrder" src="@/static/images/horn.png" />
<image v-if="query.priceOrder === 'asc'" src="@/static/images/up.png" />
<image v-if="query.priceOrder === 'desc'" src="@/static/images/down.png" />
</view>
<view class="item" @click="setQuery('salesOrder')">
销量
<image v-if="!query.salesOrder" src="@/static/images/horn.png" />
<image v-if="query.salesOrder === 'asc'" src="@/static/images/up.png" />
<image v-if="query.salesOrder === 'desc'" src="@/static/images/down.png" />
</view>
</view>
<view v-if="searchType === 'good'">
<view class="list acea-row row-between-wrapper">
<view
v-for="(item, listIndex) in list"
:key="listIndex"
class="item"
@click="goGoodsCon(item.id)"
>
<view class="pictrue">
<image :src="item.image"/>
</view>
<view class="text">
<view class="name more-t">{{ item.storeName }}</view>
<view class="vip acea-row row-between-wrapper">
<view class="flex ai-end">
<view class="money">
<text class="num" v-if="item.vipPrice && item.vipPrice > 0">{{ force2Decimal(item.vipPrice) }}</text>
<text class="num" v-else>{{ force2Decimal(item.price) }}</text>
</view>
<view class="vip-money">{{ force2Decimal(item.otPrice) }}</view>
</view>
<view class="sale">已售{{ item.sales }}</view>
</view>
</view>
</view>
</view>
<goo-skeleton
v-if="loading"
:show-avatar="false"
/>
<!-- <u-loadmore
v-if="loadend && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/> -->
</view>
<view v-else>
<view <view
:class="list.length > 0 ? '' : 'no-hotel'" class="item"
class="hotel-wrap" :class="title ? 'font-color-red' : ''"
> @click="set_where(0)"
<view class="list"> >{{ title ? title : "默认" }}
<view
v-for="(item, index) in list"
:key="index"
class="hotel-item"
>
<view class="hotel-item-main" @click="hotelItemClick(item)">
<image :src="item.logo" class="logo" />
<view class="info">
<view class="name one-t">
{{ item.name }}
</view>
<view class="type">
<view v-if="item.typeName" class="type-tag">
{{ item.typeName }}
</view>
<view v-else>&nbsp;</view>
</view>
<view class="desc">
<view class="tip one-t">
{{ item.tips || ' ' }}
</view>
<view class="btn">进店</view>
</view>
</view>
</view>
<view v-if="item.products" class="good-list">
<view
v-for="(good) in item.products"
:key="good.productId"
class="good-item"
@click="goGoodsCon(good.productId)"
>
<image :src="good.productImage" class="img" />
<view class="price">
<text class="txt"></text>
{{ force2Decimal(good.productPrice) }}
</view>
</view>
</view>
</view>
</view>
<goo-skeleton
v-if="loading"
/>
<!-- <u-loadmore
v-if="loadend && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/> -->
</view> </view>
<view class="item" @click="set_where(1)">
价格
<image src="@/static/images/horn.png" v-if="price === 0"/>
<image src="@/static/images/up.png" v-if="price === 1"/>
<image src="@/static/images/down.png" v-if="price === 2"/>
</view>
<view class="item" @click="set_where(2)">
销量
<image src="@/static/images/horn.png" v-if="stock === 0"/>
<image src="@/static/images/up.png" v-if="stock === 1"/>
<image src="@/static/images/down.png" v-if="stock === 2"/>
</view>
<!-- down -->
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
</view> </view>
<view <view
v-if="list.length === 0 && query.page > 1" class="list acea-row row-between-wrapper"
:class="'no-data-wrap-' + searchType" :class="Switch === true ? '' : 'on'"
class="no-data-wrap" ref="container"
> >
<no-good-data :type="searchType"/> <view
<recommend @click="goGoodsCon(item)"
v-if="searchType === 'good' && loadend && list.length === 0" class="item"
/> :class="Switch === true ? '' : 'on'"
v-for="(item, productListIndex) in productList"
:key="productListIndex"
:title="item.storeName"
>
<view class="pictrue" :class="Switch === true ? '' : 'on'">
<image :src="item.image" :class="Switch === true ? '' : 'on'"/>
</view>
<view class="text" :class="Switch === true ? '' : 'on'">
<view class="name more-t">{{ item.storeName }}</view>
<view class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
<view class="flex ai-end">
<view class="money" :class="Switch === true ? '' : 'on'">
<text class="num" v-if="item.vipPrice && item.vipPrice>0">{{ force2Decimal(item.vipPrice) }}</text>
<text class="num" v-else>{{ force2Decimal(item.price) }}</text>
</view>
<view class="vip-money">{{ force2Decimal(item.otPrice) }}</view>
</view>
<view class="sale">已售{{ item.sales }}</view>
</view>
</view>
</view>
</view> </view>
<no-good-data v-if="productList.length === 0 && where.page > 1" />
<Recommend v-if="productList.length === 0 && where.page > 1"></Recommend>
</view> </view>
</template> </template>
<script> <script>
import { getProducts, getHotels } from '@/api/store' import Recommend from "@/components/Recommend";
import { mapGetters } from 'vuex' import {getProducts} from "@/api/store";
import NP from 'number-precision' import {mapGetters} from 'vuex';
import NP from "number-precision";
import NoGoodData from '@/components/good/NoData' import NoGoodData from '@/components/good/NoData'
import Recommend from '@/components/Recommend'
export default { export default {
name: 'GoodsList', name: "GoodsList",
components: { components: {
NoGoodData, Recommend,
Recommend NoGoodData
}, },
props: {},
computed: mapGetters(["userInfo"]),
data: function () { data: function () {
// const { s = "", id = 0, title = "" } = this.$yroute.query;
const s = "",
id = 0,
title = "";
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
hostProduct: [],
list: [], productList: [],
query: { Switch: true,
where: {
page: 1, page: 1,
limit: 10, limit: 8,
keyword: '', keyword: s,
priceOrder: '', sid: id, //二级分类id
salesOrder: '' news: 0,
priceOrder: "",
salesOrder: ""
}, },
title: title && id ? title : "",
loadTitle: "",
loading: false, loading: false,
loadend: false, loadend: false,
searchTypeList: Object.freeze([ price: 0,
{ text: '商品', value: 'good' }, stock: 0,
{ text: '店铺', value: 'hotel' } nows: false
]), };
searchType: 'good', },
showSearchTypeLayer: false watch: {
title() {
this.updateTitle();
},
$yroute(to) {
// if (to.name !== "GoodsList") return;
// const { s = "", id = 0, title = "" } = to.query;
// if (s !== this.where.keyword || id !== this.where.sid) {
// this.where.keyword = s;
// this.loadend = false;
// this.loading = false;
// this.where.page = 1;
// this.where.sid = id;
// this.title = title && id ? title : "";
// this.nows = false;
// this.$set(this, "productList", []);
// this.price = 0;
// this.stock = 0;
// this.get_product_list();
// }
} }
}, },
computed: mapGetters(['userInfo']), onLoad: function (e) {
onLoad(e) { const {s = "", id = 0, title = ""} = this.$yroute.query;
const { s = '' } = this.$yroute.query if (s !== this.where.keyword || id !== this.where.sid) {
this.query.keyword = s this.where.keyword = s;
this.getList() this.loadend = false;
this.loading = false;
this.where.page = 1;
this.where.sid = id;
this.title = title && id ? title : "";
this.nows = false;
this.$set(this, "productList", []);
this.price = 0;
this.stock = 0;
// this.get_product_list();
}
this.updateTitle();
this.get_product_list();
},
mounted: function () {
// const { s = "", id = 0, title = "" } = this.$yroute.query;
// this.updateTitle();
// this.get_product_list();
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getList() !this.loading && this.get_product_list();
},
onHide() {
// this.hostProduct = [];
// this.productList = [];
// this.Switch = true;
// this.where = {
// page: 1,
// limit: 8,
// keyword: s,
// sid: id, //二级分类id
// news: 0,
// priceOrder: "",
// salesOrder: ""
// };
// this.loadTitle = "";
// this.loading = false;
// this.loadend = false;
// this.price = 0;
// this.stock = 0;
// this.nows = fals;
}, },
methods: { methods: {
toggleSearchType(value) {
this.showSearchTypeLayer = value
},
searchTypeItemClick(item) {
if (item.value === this.searchType) {
return
}
this.searchType = item.value
this.toggleSearchType(false)
this.submitForm()
},
force2Decimal(price) { force2Decimal(price) {
return this.$force2Decimal(price); return this.$force2Decimal(price);
}, },
goGoodsCon(id) { goGoodsCon(item) {
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/shop/GoodsCon/index', path: "/pages/shop/GoodsCon/index",
query: { id } query: {id: item.id}
}) });
}, },
hotelItemClick(item) { updateTitle() {
this.$yrouter.push({ // document.title = this.title || this.$yroute.meta.title;
path: '/pagesInn/inn/innHome',
query: {
id: item.id
}
})
}, },
getList() { get_product_list() {
if (this.loading || this.loadend) { var that = this;
return this.setWhere();
} // if (to.name !== "GoodsList") return;
let reqFn = null // const { s = "", id = 0, title = "" } = this.$yroute.query;
if (this.searchType === 'good') { // if (s !== this.where.keyword || id !== this.where.sid) {
reqFn = getProducts // this.where.keyword = s;
} else { // this.loadend = false;
reqFn = getHotels // this.loading = false;
} // this.where.page = 1;
this.loading = true // this.where.sid = id;
reqFn(this.query).then(res => { // this.title = title && id ? title : "";
const { success, data } = res // this.nows = false;
if (success) { // this.$set(this, "productList", []);
this.loading = false // this.price = 0;
this.list.push.apply(this.list, data.map((item) => { // this.stock = 0;
if (this.searchType === 'good') { // // this.get_product_list();
// 如果已经登录获取用户信息 // }
if (this.$store.getters.token && this.userInfo) { let q = that.where;
const p = NP.times(item.price, NP.divide(parseFloat(this.userInfo.discount), 100)) getProducts(q).then(res => {
item.vipPrice = p that.loading = false;
} //that.productList.push.apply(that.productList, res.data);
} that.productList.push.apply(that.productList, res.data.map((item) => {
return item
})) //如果已经登录获取用户信息
// 判断所有数据是否加载完成 if (that.$store.getters.token && that.userInfo) {
this.loadend = data.length < this.query.limit var p = NP.times(item.price, NP.divide(parseFloat(that.userInfo.discount), 100))
this.query.page++ item.vipPrice = p;
} }
}).catch(() => { return item;
this.loading = false }));
})
that.loadend = res.data.length < that.where.limit; //判断所有数据是否加载完成;
that.where.page = that.where.page + 1;
});
}, },
submitForm() { submitForm: function () {
this.$set(this, 'list', []) this.$set(this, "productList", []);
this.query.page = 1 this.where.page = 1;
this.loadend = false this.loadend = false;
this.loading = false this.loading = false;
this.getList() this.get_product_list();
}, },
setQuery(key) { //点击事件处理
const value = this.query[key] set_where: function (index) {
if (!value) { let that = this;
this.query[key] = 'asc' switch (index) {
} else if (value === 'asc') { case 0:
this.query[key] = 'desc' // return that.$yrouter.push({path: "/pages/shop/GoodsClass/index"});
} else { that.nows = false;
this.query[key] = '' that.price = 0;
that.stock = 0;
break;
case 1:
if (that.price === 0) that.price = 1;
else if (that.price === 1) that.price = 2;
else if (that.price === 2) that.price = 0;
that.stock = 0;
break;
case 2:
if (that.stock === 0) that.stock = 1;
else if (that.stock === 1) that.stock = 2;
else if (that.stock === 2) that.stock = 0;
that.price = 0;
break;
case 3:
that.nows = !that.nows;
break;
default:
break;
} }
if (key === 'priceOrder') { that.$set(that, "productList", []);
this.query.salesOrder = '' that.where.page = 1;
that.loadend = false;
that.get_product_list();
},
//设置where条件
setWhere: function () {
let that = this;
if (that.price === 0) {
that.where.priceOrder = "";
} else if (that.price === 1) {
that.where.priceOrder = "asc";
} else if (that.price === 2) {
that.where.priceOrder = "desc";
} }
if (key === 'salesOrder') { if (that.stock === 0) {
this.query.priceOrder = '' that.where.salesOrder = "";
} else if (that.stock === 1) {
that.where.salesOrder = "asc";
} else if (that.stock === 2) {
that.where.salesOrder = "desc";
} }
this.submitForm() that.where.news = that.nows ? "1" : "0";
},
switchTap: function () {
let that = this;
that.Switch = !that.Switch;
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.productList {
min-height: 100vh;
background-color: #f7f7f7;
.list {
margin: 0;
padding: 172rpx 20rpx 0 20rpx;
}
.no-hotel {
padding: 0;
}
.no-data-wrap {
position: relative;
min-height: calc(100vh - 172rpx);
background-color: #fff;
}
.no-data-wrap-hotel {
min-height: calc(100vh - 86rpx);
}
}
.noCommodity { .noCommodity {
display: flex; display: flex;
justify-content: center; justify-content: center;
@@ -356,185 +343,33 @@ export default {
} }
} }
} }
.search-type-layer {
position: fixed; .list.on {
top: 0; padding: 0 32rpx;
left: 0; background: none;
right: 0;
bottom: 0;
z-index: 9999;
.layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, 0.5);
}
.content {
position: absolute;
top: 80rpx;
left: 23rpx;
z-index: 5;
width: 70px;
padding: 10rpx 20rpx;
border-radius: 4px;
background-color: #fff;
.item + .item {
border-top: 1px solid #eee;
}
.item {
text-align: center;
line-height: 40px;
font-size: 16px;
color: #333;
&.on {
color: #E92727;
}
}
}
}
.search-wrap {
background-color: #fff;
.input {
height: 36px;
border-radius: 18px;
margin: 0;
background-color: #f6f6f6;
.search-type-wrap {
display: flex;
align-items: center;
padding: 0 20rpx 0 0;
border-right: 1px solid #ddd;
color: #999;
font-size: 26rpx;
.d3 {
width: 0;
height: 0;
margin: 0 0 -6px 4px;
border-width: 5px;
border-style: solid;
border-color: #999 transparent transparent transparent;
}
}
.inp {
flex: 1;
padding: 0 0 0 20rpx;
}
.iconfont {
color: #E92727;
}
}
}
.nav {
.item { .item {
width: 33.3333%; box-sizing: border-box;
.tag { margin-top: 24rpx;
display: inline-block; padding: 24rpx 22rpx;
width: 72px; border-bottom: none;
height: 28px;
border-radius: 15px; .pictrue {
border: 1px solid #E92727; width: 136rpx !important;
color: #E92727; height: 136rpx !important;
text-align: center;
line-height: 28px;
} }
}
} .text {
.hotel-wrap {
padding: 0 0 23rpx 0;
.list {
padding-top: 86rpx;
background-color: #f7f7f7;
}
}
.hotel-item {
padding: 15rpx;
margin: 23rpx 0 0 0;
border-radius: 4px;
background-color: #fff;
box-shadow: 0px 3px 6px rgba(0,0,0,0.16);
.hotel-item-main {
display: flex;
justify-content: center;
}
.logo {
display: block;
width: 136rpx;
height: 136rpx;
border-radius: 6px;
}
.info {
width: calc(100% - 160rpx);
padding: 0 0 0 20rpx;
.name {
font-size: 16px;
color: #333;
font-weight: bold;
}
.type {
display: flex;
margin: 10rpx 0 0 0;
.type-tag {
padding: 2px 6px;
border-radius: 3px;
font-size: 12px;
color: #946300;
background: linear-gradient(to bottom, #FDF8B9, #E3A72C);
}
}
.desc {
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: center;
font-size: 14px; .money {
.tip { margin-top: 0;
flex: 1;
width: calc(100% - 120rpx);
color: #999;
} }
.btn {
padding: 0 15px; .vip-money {
height: 28px; margin-left: 8rpx;
border-radius: 14px;
color: #fff;
line-height: 28px;
background-color: #C51919;
}
}
}
.good-list {
display: flex;
justify-content: flex-start;
flex-wrap: nowrap;
padding: 23rpx 0 0 0;
overflow-x: auto;
.good-item + .good-item {
margin: 0 0 0 15rpx;
}
.good-item {
position: relative;
.img {
display: block;
width: 210rpx;
height: 210rpx;
border-radius: 6px;
}
.price {
position: absolute;
bottom: 20rpx;
left: 50%;
padding: 8rpx 20rpx;
border-radius: 23rpx;
line-height: 30rpx;
font-size: 28rpx;
color: #333;
background-color: #fff;
transform: translateX(-50%);
.txt {
font-size: 22rpx;
}
} }
} }
} }
-282
View File
@@ -1,282 +0,0 @@
<template>
<view class="v12-pb-10">
<view class="v12-justify-around v12-pa-2 v12-white data-nav">
<view
v-for="(day, i) in currentWeek"
:key="i"
class="v12-font-26"
>
<view style="color:#BCBCBC" class="day-wrap">{{ getDate(day) }}</view>
<view class="v12-dark-text day-wrap" :class="{'active': actived === i, 'disabled': disabled(day)}" @click="handle(day, i)">{{ getDay(day) }}</view>
</view>
</view>
<view v-if="isLoad" class="history-wrap">
<view
v-for="(item, index) in items"
:key="index"
class="v12-mt-3"
:id="`history-${item.historyDate}`"
>
<view class="" style="height: 56px; width: 100%" v-if="isSrcoll"></view>
<view >
<text class="v12-font-bold v12-font-32">{{ item.historyDate }}</text>
<view class="wrapper">
<view
v-for="(historyItem, historyKey) in item.histories"
:key="historyKey"
class="v12-white v12-radius-20 history-card"
@click="goodsDetail(historyItem)"
>
<image
class="goods-img"
:src="historyItem.image"
mode="scaleToFill"
/>
<view class="good-info">
<view
:style="{
opacity: !historyItem.couponName ? 0 : 1
}"
class="v12-align-center v12-mt-2"
>
<view class="v12-primary-text v12-primary-border v12-radius-6 v12-font-18 v12-px-1"></view>
<view class="v12-primary-text v12-primary-border v12-radius-6 v12-font-18 v12-px-1">{{ historyItem.couponName }}</view>
</view>
<view class="v12-justify-between v12-mt-2 price">
<view class="v12-font-bold v12-primary-text v12-align-center">
<text class="v12-font-16"></text>
<text class="v12-font-24">{{ historyItem.price }}</text>
<view class="ot-price v12-font-weight-400">
<text class="v12-font-22"></text>
<text class="v12-font-22">{{ historyItem.otPrice }}</text>
<view class="under-line"></view>
</view>
</view>
<image
:src="webUrl+'/orderIcon/组 355.png'"
class="icon"
/>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="v12-px-6" v-if="items.length > 0">
<u-divider text=" · 已经到底啦 · " textPosition="center"></u-divider>
</view>
<image
v-if="items.length === 0"
:src="webUrl + '/orderIcon/nohistory.png'"
class="img-nodata v12-mt-16"
mode="widthFix"
/>
</view>
<goo-skeleton
v-else
:show-avatar="false"
/>
</view>
</template>
<script>
import { getHistory } from '@/api/user'
export default {
data() {
return {
currentWeek: [],
actived: 0,
webUrl: this.$VUE_APP_RESOURCES_URL,
isLoad: false,
items: [],
isSrcoll: false
}
},
onLoad() {
this.queryHistory()
},
onShow() {
this.$nextTick(() => {
this.currentWeek = this.getWeek()
this.actived = this.getActived()
})
},
methods: {
disabled(day) {
const dayItems = this.items.filter(item => {
return item.historyDate === day
}).map(e => {
return e.histories
}).flat()
return dayItems.length === 0
},
getActived() {
const weekMap = this.currentWeek.map(e => new Date(e).getDay())
const today = new Date().getDay()
return weekMap.indexOf(today)
},
getWeek() {
const dates = []
const now = new Date();
// 0-6, 0是周日
const dayOfWeek = now.getDay()
// 当前日
const numDate = now.getDate()
const numDaysToMonday = dayOfWeek - 1 > -1 ? dayOfWeek : 0
// 得到本周周一的日期
const monday = new Date(now)
monday.setDate(numDate - numDaysToMonday)
// 生成本周剩余的日期
for (let i = 0; i < 7; i++) {
dates.push(new Date(monday).toISOString().slice(0, 10))
monday.setDate(monday.getDate() + 1)
}
return dates
},
getDay(date) {
return new Date(date).getDate()
},
getDate(date) {
const dateMap = {
1: '一',
2: '二',
3: '三',
4: '四',
5: '五',
6: '六',
0: '日'
}
const d = new Date(date).getDay()
return dateMap[d]
},
handle(day, i) {
if(this.disabled(day)) return
this.actived = i
this.isSrcoll = true
uni.pageScrollTo({
selector:`#history-${day}`,
duration:200,
success:(success)=>{
this.isSrcoll = false
},
})
},
formatStr(str) {
const regx = /-/g
return str.replace(regx, '')
},
goodsDetail (item) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.productId
}
})
},
queryHistory() {
this.items = []
this.isLoad = false
getHistory().then(res => {
const { data = [] } = res
if (data.length > 0) {
this.items = data.filter(e => e.histories && e.histories.length > 0).reverse()
// data.map(item => {
// if (item.histories) {
// if (item.histories.length > 0) {
// this.items.push(item)
// }
// }
// })
}
}).finally(() => {
this.isLoad = true
})
}
}
}
</script>
<style lang="less" scoped>
.data-nav{
position: sticky;
width: 100%;
top: 0;
z-index: 9;
box-sizing: border-box;
}
.disabled{
color: #CBCBCB !important;
}
.history-wrap {
padding: 0 20rpx;
.img-nodata {
width: 100%;
}
}
.under-line{
width: 100%;
height: 3rpx;
background-color: #CBCBCB;
position: absolute;
top: 4rpx;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.wrapper{
display: flex;
flex-wrap: wrap;
width: 710rpx;
margin: 0 auto;
}
.history-card{
width: 226rpx;
box-sizing: border-box;
margin-top: 16rpx;
margin-right: 16rpx;
border-radius: 20rpx;
overflow: hidden;
&:nth-child(3n) {
margin-right: 0;
}
.goods-img {
display: block;
width: 226rpx;
height: 226rpx;
}
.good-info {
padding: 12rpx 12rpx 20rpx 12rpx;
.price {
line-height: 34rpx;
.ot-price {
margin: 0 0 0 10rpx;
color: #CBCBCB;
position: relative;
}
}
.icon {
display: block;
width: 34rpx;
height: 34rpx;
}
}
}
.active{
background: #C52733;
color: #fff !important;
}
.day-wrap{
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
border-radius: 50%;
}
</style>
-368
View File
@@ -1,368 +0,0 @@
<template>
<view class="point-page">
<view v-if="isLoad">
<view class="rule-btn" @click="showHidePopup(true)">
积分规则
</view>
<view class="tab-wrap">
<view
:class="query.pm === 1 ? 'curr' : ''"
class="tab-item"
@click="tabItemClick(1)"
>
<view class="txt">当前总积分</view>
<view class="number">
<image
v-if="query.pm === 1"
:src="webUrl + '/page/my/coin.png'"
class="icon"
/>
{{ point.currentPoints }}
</view>
</view>
<view
:class="query.pm === 0 ? 'curr' : ''"
class="tab-item"
@click="tabItemClick(0)"
>
<view class="txt">已使用积分</view>
<view class="number">
<image
v-if="query.pm === 0"
:src="webUrl + '/page/my/coin.png'"
class="icon"
/>
{{ point.totalUsedPoints }}
</view>
</view>
</view>
<view class="list-wrap">
<view
v-for="(item, index) in list"
:key="index"
class="item"
>
<view v-if="item.orderId" class="order">
<view class="title">
<view class="img">
<image :src="item.image" class="img" />
</view>
<view class="name more-t">
<view class="more-t">
{{ item.title }}
</view>
<view
:class="item.pm ? 'red' : 'green'"
class="number"
>
{{ item.pm ? '+' : '-' }}{{ item.number }}
<text class="txt">积分</text>
</view>
</view>
</view>
<view class="bottom" @click="goOrderDetails(item)">
<view class="txt">
点击查看详情 >>
</view>
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<view v-else class="lottery">
<image :src="webUrl + '/points-lottery.png'" class="img" />
<view class="one-t title">
{{ item.title }}
</view>
<view
:class="item.pm ? 'red' : 'green'"
class="number"
>
{{ item.pm ? '+' : '-' }}{{ item.number }}
<text class="txt">积分</text>
</view>
</view>
</view>
<goo-skeleton
v-if="isLoading"
:show-avatar="false"
/>
<view v-else>
<view v-if="list.length === 0" class="no-data">
暂无数据
</view>
<!-- <u-loadmore
v-if="query.page >= totalPage && list.length > 0"
:line="true"
status="nomore"
nomore-text="到底了"
/> -->
</view>
</view>
</view>
<goo-skeleton
v-else
:show-avatar="false"
/>
<u-popup
:show="show"
mode="center"
round="10"
closeable
@close="showHidePopup(false)"
>
<view class="popup-body">
<view class="title bold">积分规则</view>
<view class="content">
<view class="content-html">
<rich-text :nodes="point.pointsRule" />
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
getUserPointInfo,
getUserPointBill
} from '@/api/user'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default {
name: 'UserPoints',
mixins: [pageListenMixins],
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
query: {
pm: 1, // 0-支出,1-收入
page: 1,
limit: 10
},
isLoading: false,
list: [],
totalPage: 1,
isLoad: false,
point: {
currentPoints: 0, // 当前总积分
totalUsedPoints: 0, // 累计使用积分
pointsRule: ''
},
show: false,
pageKeyId: Object.freeze('userPointsBill')
}
},
created() {
this.getInfo()
},
onReachBottom() {
if (this.isLoading || this.query.page >= this.totalPage) {
return
}
this.query.page++
this.getList()
},
methods: {
tabItemClick(type) {
if (this.query.pm === type) {
return
}
this.query.pm = type
this.query.page = 1
this.list = []
this.getList()
},
getInfo() {
getUserPointInfo().then(res => {
const { success, data } = res
if (success) {
this.isLoad = true
this.point = data
this.getList()
}
})
},
getList() {
this.isLoading = true
getUserPointBill(this.query).then(res => {
const { success, data } = res
if (success) {
this.totalPage = data.pages || 1
if (data.records.length > 0) {
data.records.map(item => {
this.list.push(item)
})
}
}
}).finally(() => {
this.isLoading = false
})
},
goOrderDetails(order) {
this.$yrouter.push({
path: '/pages/order/OrderDetails/index',
query: {
id: order.orderId
}
})
},
showHidePopup(value) {
this.show = value
}
}
}
</script>
<style lang="less" scoped>
.point-page {
padding: 30rpx;
.rule-btn {
position: fixed;
right: 0;
top: 255rpx;
z-index: 9;
height: 24rpx;
padding: 20rpx 30rpx 20rpx 40rpx;
border-top-left-radius: 35rpx;
border-bottom-left-radius: 35rpx;
color: #fff;
font-size: 14px;
line-height: 24rpx;
background-color: #C51919;
}
.tab-wrap {
display: flex;
align-items: center;
.tab-item {
flex: 1;
justify-content: center;
padding: 20rpx;
border-radius: 15rpx;
background-color: #fff;
.txt {
width: 100px;
height: 36px;
padding: 0 20rpx;
margin: 0 auto;
border-radius: 4px;
border: 1px solid #C51919;
line-height: 36px;
text-align: center;
color: #C51919;
font-size: 16px;
}
.number {
display: flex;
justify-content: center;
align-items: center;
margin: 20rpx 0 0 0;
font-size: 20px;
color: #333;
font-weight: bold;
line-height: 26px;
.icon {
width: 40rpx;
height: 40rpx;
margin: 0 20rpx 0 0;
}
}
&.curr {
padding: 35rpx 20rpx;
background-color: #C51919;
.txt {
border-color: #fff;
color: #fff;
}
.number {
font-size: 26px;
color: #fff;
}
}
}
}
.list-wrap {
padding: 60rpx 0 0 0;
.item {
margin: 30rpx 0 0 0;
border-radius: 8px;
background-color: #fff;
.order {
.title {
display: flex;
padding: 20rpx;
.img {
display: block;
width: 120rpx;
height: 120rpx;
margin: 0 20rpx 0 0;
background-color: #f6f6f6;
}
.name {
width: calc(100% - 140rpx);
color: #333;
}
}
.bottom {
display: flex;
padding: 20rpx;
border-top: 1rpx solid #f6f6f6;
font-size: 12px;
color: #666;
.txt {
flex: 1;
color: #FD5749;
}
.iconfont {
font-size: 14px;
}
}
}
.lottery {
display: flex;
align-items: center;
padding: 20rpx;
.img {
display: block;
width: 62rpx;
height: 62rpx;
margin: 0 20rpx 0 0;
}
.title {
flex: 1;
}
}
.number {
text-align: right;
font-size: 18px;
font-weight: bold;
.txt {
font-size: 12px;
}
&.red {
color: #FD5749;
}
&.green {
color: #3DC260;
}
}
}
}
.no-data {
line-height: 200rpx;
text-align: center;
font-size: 16px;
color: #999;
}
.popup-body {
.title {
line-height: 80rpx;
text-align: center;
}
.content {
padding: 0 30rpx 30rpx 30rpx;
.content-html {
max-height: 70vh;
overflow-y: auto;
}
}
}
}
</style>
+14 -70
View File
@@ -1,5 +1,5 @@
<template> <template>
<view class="user user-page tabbar-page"> <view class="user user-page">
<view <view
v-if="$store.getters.token || userInfo.uid" v-if="$store.getters.token || userInfo.uid"
class="acea-row row-column" class="acea-row row-column"
@@ -31,9 +31,7 @@
<view class="info"> <view class="info">
<view class="name-cont"> <view class="name-cont">
<view class="txt flex"> <view class="txt flex">
<view class="txt-cont"> {{ userInfo.nickname }}
{{ userInfo.nickname }}
</view>
<image <image
:src="webUrl + '/page/my/img-vip.png'" :src="webUrl + '/page/my/img-vip.png'"
class="vip" class="vip"
@@ -59,7 +57,7 @@
余额 余额
</view> </view>
</view> </view>
<view class="item" @click="linkTo('/pages/user/Points/index')"> <view class="item">
<view class="number"> <view class="number">
{{ userInfo.integral || 0 }} {{ userInfo.integral || 0 }}
</view> </view>
@@ -156,7 +154,7 @@
</view> </view>
<text>待评价</text> <text>待评价</text>
</view> </view>
<view @click="goMyOrder(5)" class="item"> <view @click="goReturnList()" class="item">
<view class="pictrue"> <view class="pictrue">
<image <image
:src="webUrl+'/icon/icon-order-status5.png'" :src="webUrl+'/icon/icon-order-status5.png'"
@@ -203,19 +201,12 @@
</view> </view>
</view> </view>
<!-- 我的服务结束 --> <!-- 我的服务结束 -->
<view v-if="userCenterCarouselShow === 1 && userCenterCarousel.length > 0" class="banner-wrap"> <view v-if="bannerBgUrl" class="banner-wrap">
<!-- <image <image
:src="bannerBgUrl" :src="bannerBgUrl"
mode="widthFix" mode="widthFix"
class="bg" class="bg"
@click="bannerClickHandle" />
/> -->
<u-swiper
:list="userCenterCarousel"
keyName="image"
img-mode="aspectFit"
@click="handleSwiper"
></u-swiper>
</view> </view>
</view> </view>
</view> </view>
@@ -245,12 +236,10 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<xdd-tabbar :curr-index="3" />
</view> </view>
</template> </template>
<script> <script>
import XddTabbar from '@/components/xdd-tabbar'
import {mapGetters, mapMutations} from "vuex" import {mapGetters, mapMutations} from "vuex"
import { import {
getSpreadImg, getSpreadImg,
@@ -261,17 +250,10 @@ import {
} from "@/api/user" } from "@/api/user"
import {isWeixin} from "@/utils" import {isWeixin} from "@/utils"
import cookie from "@/utils/store/cookie" import cookie from "@/utils/store/cookie"
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: 'UserPage', name: 'UserPage',
components: {
XddTabbar
},
mixins: [pageListenMixins],
data() { data() {
return { return {
userCenterCarousel: [],
userCenterCarouselShow: 0,
statusBarHeight: uni.getSystemInfoSync().statusBarHeight, statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
isWeixin: false, isWeixin: false,
@@ -333,10 +315,11 @@ export default {
allowEnter: true allowEnter: true
}, },
{ {
text: '商品足迹', text: '帮助中心',
url: '/pages/user/History/index', url: '',
icon: '/icon/icon-help.png', icon: '/icon/icon-help.png',
allowEnter: true allowEnter: true,
showTip: true
}, },
{ {
text: '设置中心', text: '设置中心',
@@ -345,9 +328,7 @@ export default {
allowEnter: true allowEnter: true
} }
], ],
bannerBgUrl: '', bannerBgUrl: ''
userCenterBannerUrl: '',
pageKeyId: Object.freeze('userIndex')
} }
}, },
computed: mapGetters(['userInfo']), computed: mapGetters(['userInfo']),
@@ -375,14 +356,9 @@ export default {
}, },
onHide() { onHide() {
this.updateAuthorizationPage(false) this.updateAuthorizationPage(false)
this.pageToHideHandle()
}, },
methods: { methods: {
...mapMutations(['updateAuthorizationPage']), ...mapMutations(['updateAuthorizationPage']),
handleSwiper(e) {
const url = this.userCenterCarousel[e].url
this.linkTo(url)
},
goRoomLogs() { goRoomLogs() {
uni.navigateTo({ uni.navigateTo({
url: '/pkg_common/views/roomLogs' url: '/pkg_common/views/roomLogs'
@@ -426,18 +402,10 @@ export default {
this.$yrouter.push('/pages/order/ReturnList/index') this.$yrouter.push('/pages/order/ReturnList/index')
}, },
goMyOrder(type) { goMyOrder(type) {
const types = {
0: 0,
1: 1,
2: 2,
3: 3,
4: 5,
5: 4,
}
this.$yrouter.push({ this.$yrouter.push({
path: '/pages/order/MyOrder/index', path: '/pages/order/MyOrder/index',
query: { query: {
type: types[type] type
} }
}) })
}, },
@@ -459,11 +427,6 @@ export default {
uni.hideLoading() uni.hideLoading()
}).catch(err => { }).catch(err => {
uni.hideLoading() uni.hideLoading()
if (err.toLogin) {
uni.reLaunch({
url: '/pages/authorization/index'
})
}
}).finally(() => { }).finally(() => {
uni.hideLoading() uni.hideLoading()
}) })
@@ -471,11 +434,8 @@ export default {
getUserCenterBanner().then(res => { getUserCenterBanner().then(res => {
const { success, data } = res const { success, data } = res
if (success) { if (success) {
this.userCenterCarousel = data.userCenterCarousel || []
this.userCenterCarouselShow = data.userCenterCarouselShow
if (data.userCenterBanner) { if (data.userCenterBanner) {
this.bannerBgUrl = data.userCenterBanner this.bannerBgUrl = data.userCenterBanner
this.userCenterBannerUrl = data.userCenterBannerUrl || ''
} }
} }
}) })
@@ -525,21 +485,12 @@ export default {
return return
} }
uni.navigateTo({ url }) uni.navigateTo({ url })
},
bannerClickHandle() {
if (!this.userCenterBannerUrl) {
return
}
this.linkTo(this.userCenterBannerUrl)
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.full-width{
width: 100%;
}
.innTag { .innTag {
margin-left: -30rpx; margin-left: -30rpx;
width: 196rpx; width: 196rpx;
@@ -670,13 +621,10 @@ export default {
color: #fff; color: #fff;
.name-cont { .name-cont {
.txt { .txt {
align-items: baseline; align-items: flex-end;
margin: 0 0 32rpx 0; margin: 0 0 32rpx 0;
font-size: 26px; font-size: 26px;
line-height: 26px; line-height: 26px;
.txt-cont {
max-width: 400rpx;
}
.vip { .vip {
margin: 0 0 0 12rpx; margin: 0 0 0 12rpx;
width: 48rpx; width: 48rpx;
@@ -686,7 +634,6 @@ export default {
.qrcode { .qrcode {
display: flex; display: flex;
align-items: center; align-items: center;
width: 160rpx;
padding: 10rpx 16rpx; padding: 10rpx 16rpx;
border: 1rpx solid #FFFBD3; border: 1rpx solid #FFFBD3;
border-radius: 8rpx; border-radius: 8rpx;
@@ -769,7 +716,4 @@ export default {
height: 52rpx; height: 52rpx;
} }
} }
.tabbar-page {
padding: 0 0 180rpx 0;
}
</style> </style>
+2 -16
View File
@@ -25,24 +25,19 @@
</view> </view>
</view> </view>
<Loading :loaded="loaded" :loading="loading"></Loading> <Loading :loaded="loaded" :loading="loading"></Loading>
<view v-if="loaded && list.length === 0">
<image :src="webUrl + '/noConsumption.png'" class="no-data"></image>
</view>
</view> </view>
</template> </template>
<script> <script>
import { getCommissionInfo } from "@/api/user"; import { getCommissionInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserBill", name: "UserBill",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins], props: {},
data: function() { data: function() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL,
types: 0, types: 0,
where: { where: {
page: 1, page: 1,
@@ -50,8 +45,7 @@ export default {
}, },
list: [], list: [],
loaded: false, loaded: false,
loading: false, loading: false
pageKeyId: Object.freeze('userBalanceBill')
}; };
}, },
watch: { watch: {
@@ -118,11 +112,3 @@ export default {
} }
}; };
</script> </script>
<style lang="less" scoped>
.no-data {
display: block;
width: 500rpx;
height: 500rpx;
margin: 100rpx auto;
}
</style>
+47 -138
View File
@@ -7,7 +7,7 @@
</view> </view>
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">联系电话</view> <view class="name">联系电话</view>
<input type="number" placeholder="请输入联系电话" v-model="userAddress.phone" required :maxlength="11"/> <input type="text" placeholder="请输入联系电话" v-model="userAddress.phone" required :maxlength="11"/>
</view> </view>
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<view class="name">所在地区</view> <view class="name">所在地区</view>
@@ -29,31 +29,6 @@
<!-- <textarea v-model="userAddress.detail" placeholder="请填写具体地址" /> --> <!-- <textarea v-model="userAddress.detail" placeholder="请填写具体地址" /> -->
</view> </view>
</view> </view>
<view class="address-analysis-wrap">
<view class="inp">
<textarea
v-model.trim="addressInput"
placeholder="请粘贴收件人手机号、姓名、收货地址并用空格区分,系统将自动识别地址信息"
placeholder-style="font-size:24rpx;color:#C2C5CC;"
class="inp-textarea"
/>
</view>
<view class="btn-wrap">
<view
class="txt"
@click="clearHandle"
>
清空
</view>
<view
:class="addressInput ? '' : 'disable'"
class="btn"
@click="distinguishHandle"
>
识别
</view>
</view>
</view>
<view class="default acea-row row-middle"> <view class="default acea-row row-middle">
<view class="select-btn"> <view class="select-btn">
<view class="checkbox-wrapper"> <view class="checkbox-wrapper">
@@ -73,94 +48,71 @@
</template> </template>
<script type="text/babel"> <script type="text/babel">
import CitySelect from '@/components/CitySelect' import CitySelect from "@/components/CitySelect";
import config from '@/utils/mapConfig' import config from '@/utils/mapConfig';
import { getAddress, getCity, postAddress, analysisAddress } from '@/api/user' import {getAddress, getCity, postAddress} from "@/api/user";
import attrs, { chs_extphone, required } from '@/utils/validate' import attrs, {chs_extphone, required} from "@/utils/validate";
import { validatorDefaultCatch } from '@/utils/dialog' import {validatorDefaultCatch} from "@/utils/dialog";
import { isWeixin } from '@/utils' // import { openAddress } from "@/libs/wechat";
import { pageListenMixins } from '@/mixins/pageListenMixins' import {isWeixin} from "@/utils";
export default { export default {
name: "AddAddress", name: "AddAddress",
components: { components: {
CitySelect CitySelect
}, },
mixins: [pageListenMixins], computed: {},
data() { data() {
return { return {
district: [], district: [],
id: 0, id: 0,
userAddress: { userAddress: {isDefault: 0},
realName: '',
phone: '',
detail: '',
isDefault: 0
},
address: {}, address: {},
isWechat: isWeixin(), isWechat: isWeixin(),
addressText: "", addressText: ""
pageKeyId: Object.freeze('userAddressEdit'),
addressInput: ''
}; };
}, },
mounted: function () { mounted: function () {
const id = this.$yroute.query.id let id = this.$yroute.query.id;
this.id = id this.id = id;
if (this.id) { if (this.id) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '编辑地址' title: '编辑地址'
}) })
} }
this.getUserAddress() this.getUserAddress();
this.getCityList() this.getCityList();
},
watch: {
// addressText(nextModel2) {
// console.log(nextModel2, 8585858585);
// }
//定位成功后回调
// province(newVal,oldVal){
// uni.hideLoading();
// //if(newVal!=oldVal){
// this.addressText =
// this.province + " " + this.city + " " + this.county;
// this.address.province = this.province;
// this.address.city = this.city;
// this.address.district = this.county;
// this.userAddress.detail = this.detailAddress;
// //}
// }
}, },
methods: { methods: {
getIndex(value, arr) { getIndex(value, arr) {
var idx = -1 var idx = -1;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (arr[i].n == value) { if (arr[i].n == value) {
idx = i idx = i;
break break;
} }
} }
return idx return idx;
},
clearHandle() {
if (!this.addressInput) return
this.addressInput = ''
},
// 识别
distinguishHandle() {
if (!this.addressInput) return
uni.showLoading()
analysisAddress({
content: this.addressInput
}).then((res) => {
uni.hideLoading()
console.log(res)
const { success, data } = res
if (success) {
this.address = {
province: data.province || '',
city: data.city || '',
district: data.district || '',
city_id: data.cityId
}
this.userAddress.realName = data.realName || ''
this.userAddress.phone = data.phone || ''
this.userAddress.detail = data.detail || ''
this.addressText = `${this.address.province} ${this.address.city} ${this.address.district}`
}
}).catch((err) => {
uni.hideLoading()
uni.showToast({
title: err.msg + '',
icon: 'none',
mask: false,
duration: 1500
})
})
}, },
//获取当前定位地址 //获取当前定位地址
getCurAddress() { getCurAddress() {
@@ -302,7 +254,8 @@ export default {
let that = this; let that = this;
getAddress(that.id).then(res => { getAddress(that.id).then(res => {
that.userAddress = res.data; that.userAddress = res.data;
that.addressText = res.data.province + " " + res.data.city + " " + res.data.district; that.addressText =
res.data.province + " " + res.data.city + " " + res.data.district;
that.address.province = res.data.province; that.address.province = res.data.province;
that.address.city = res.data.city; that.address.city = res.data.city;
that.address.district = res.data.district; that.address.district = res.data.district;
@@ -326,11 +279,11 @@ export default {
getAddress() { getAddress() {
}, },
async submit() { async submit() {
const name = this.userAddress.realName || '' let name = this.userAddress.realName,
const phone = this.userAddress.phone || '' phone = this.userAddress.phone,
const addressText = this.addressText || '' addressText = this.addressText,
const detail = this.userAddress.detail || '' detail = this.userAddress.detail,
const isDefault = this.userAddress.isDefault isDefault = this.userAddress.isDefault;
if (phone.length < 11) { if (phone.length < 11) {
uni.showToast({ uni.showToast({
@@ -368,7 +321,7 @@ export default {
is_default: isDefault ? true : false, is_default: isDefault ? true : false,
post_code: "" post_code: ""
}; };
postAddress(data).then(function (res) { postAddress(data).then(function () {
if (that.id) { if (that.id) {
uni.showToast({ uni.showToast({
title: "修改成功", title: "修改成功",
@@ -382,20 +335,6 @@ export default {
duration: 2000 duration: 2000
}); });
} }
if(that.$yroute.query.choosMode == 1) {
const item = {
id: res.data.id,
realName: name,
phone: phone,
district: that.address.district,
province: that.address.province,
city: that.address.city,
detail: detail,
is_default: isDefault ? true : false,
post_code: ""
}
uni.$emit('chooseAddress', item)
}
that.$yrouter.back(); that.$yrouter.back();
}); });
} catch (err) { } catch (err) {
@@ -433,34 +372,4 @@ export default {
display: block; display: block;
} }
} }
.address-analysis-wrap {
padding: 20rpx;
margin: 20rpx;
border-radius: 15rpx;
background-color: #fff;
font-size: 24rpx;
.inp-textarea {
width: 100%;
height: 120rpx;
}
.btn-wrap {
display: flex;
justify-content: flex-end;
align-items: center;
margin: 20rpx 0 0 0;
.txt {
color: #999;
}
.btn {
padding: 12rpx 25rpx;
margin: 0 0 0 20rpx;
border-radius: 8rpx;
color: #fff;
background-color: #FE5261;
&.disable {
opacity: 0.75;
}
}
}
}
</style> </style>
@@ -6,7 +6,7 @@
> >
<view style="margin-bottom: 12rpx;" class="line" v-if="addressList.length > 0"> <view style="margin-bottom: 12rpx;" class="line" v-if="addressList.length > 0">
<!-- <image :src="webUrl+'/20230304135025917856.png'"/> --> <image :src="webUrl+'/20230304135025917856.png'"/>
</view> </view>
<view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList" <view style="position: relative;" class="item" v-for="(item, addressListIndex) in addressList"
:key="addressListIndex" @click="tapAddress(item)"> :key="addressListIndex" @click="tapAddress(item)">
@@ -81,13 +81,11 @@
import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user"; import {getAddressDefaultSet, getAddressList, getAddressRemove} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import {isWeixin} from "@/utils"; import {isWeixin} from "@/utils";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -98,8 +96,7 @@ export default {
loadTitle: "", loadTitle: "",
loading: false, loading: false,
loadend: false, loadend: false,
isWechat: isWeixin(), isWechat: isWeixin()
pageKeyId: Object.freeze('userAddressIndex')
}; };
}, },
mounted: function () { mounted: function () {
@@ -41,14 +41,13 @@
<script> <script>
import { getCommissionInfo, getSpreadInfo } from "@/api/user"; import { getCommissionInfo, getSpreadInfo } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "CommissionDetails", name: "CommissionDetails",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins], props: {},
data: function() { data: function() {
return { return {
info: [], info: [],
@@ -59,8 +58,7 @@ export default {
}, },
types: 9,//3, types: 9,//3,
loaded: false, loaded: false,
loading: false, loading: false
pageKeyId: Object.freeze('userSpreadBill')
}; };
}, },
mounted: function() { mounted: function() {
@@ -113,10 +111,3 @@ export default {
} }
}; };
</script> </script>
<style scoped lang="less">
.promoterHeader {
.headerCon {
box-sizing: border-box;
}
}
</style>
+2 -4
View File
@@ -126,14 +126,13 @@
<script> <script>
import {getSpreadUser} from "@/api/user"; import {getSpreadUser} from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterList", name: "PromoterList",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins], props: {},
data: function () { data: function () {
return { return {
fixedState: false, fixedState: false,
@@ -154,8 +153,7 @@ export default {
loadTitle: "", loadTitle: "",
first: "", first: "",
second: "", second: "",
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL
pageKeyId: Object.freeze('userSpreadStat')
}; };
}, },
mounted: function () { mounted: function () {
+23 -34
View File
@@ -10,7 +10,7 @@
</view> </view>
</view> </view>
<view class="" style="flex-grow: 1;font-size: 24rpx;"> <view class="" style="flex-grow: 1;font-size: 24rpx;">
{{ ruleText }} 返佣说明1.下线客户下单成功后平台设置为默认7天收货成功佣金便自动计算添加到上线的返佣2.如过程中下单客户有退货退款则此订单返佣无效会自动取消或相应扣除
</view> </view>
</view> </view>
</view> </view>
@@ -60,15 +60,14 @@
</view> </view>
</template> </template>
<script> <script>
import { getSpreadOrder, getUserSpreadRule } from "@/api/user"; import { getSpreadOrder } from "@/api/user";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "PromoterOrder", name: "PromoterOrder",
components: { components: {
Loading Loading
}, },
mixins: [pageListenMixins], props: {},
data: function() { data: function() {
return { return {
list: [], list: [],
@@ -78,49 +77,39 @@ export default {
}, },
loaded: false, loaded: false,
loading: false, loading: false,
loadTitle: '', loadTitle: "",
count: '', count: ""
ruleText: '', };
pageKeyId: Object.freeze('userSpreadOrder')
}
}, },
mounted() { mounted: function() {
this.getIndex() this.getIndex();
this.getRuleText()
}, },
onReachBottom() { onReachBottom() {
!this.loading && this.getIndex() !this.loading && this.getIndex();
}, },
methods: { methods: {
getRuleText() { getIndex: function() {
getUserSpreadRule().then(res => { let there = this;
const { success, data } = res if (there.loaded == true || there.loading == true) return;
if (success) { there.loading = true;
this.ruleText = data.userSpreadRule || ''
}
})
},
getIndex() {
let there = this
if (there.loaded == true || there.loading == true) return
there.loading = true
getSpreadOrder(there.where).then( getSpreadOrder(there.where).then(
res => { res => {
there.loading = false there.loading = false;
there.loaded = res.data.list.length < there.where.limit there.loaded = res.data.list.length < there.where.limit;
there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多" there.loadTitle = there.loaded ? "人家是有底线的" : "上拉加载更多";
there.where.page = there.where.page + 1 there.where.page = there.where.page + 1;
there.list.push.apply(there.list, res.data.list) there.list.push.apply(there.list, res.data.list);
there.count = res.data.count there.count = res.data.count;
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg|| err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}) });
} },
) 300
);
} }
} }
}; };
+3 -4
View File
@@ -100,11 +100,11 @@
import { getSpreadInfo } from "@/api/user"; import { getSpreadInfo } from "@/api/user";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
name: "UserPromotion", name: "UserPromotion",
mixins: [pageListenMixins], components: {},
props: {},
data: function() { data: function() {
return { return {
Info: { Info: {
@@ -112,8 +112,7 @@ export default {
extractCount: 0, extractCount: 0,
commissionCount: 0 commissionCount: 0
}, },
webUrl:this.$VUE_APP_RESOURCES_URL, webUrl:this.$VUE_APP_RESOURCES_URL
pageKeyId: Object.freeze('userSpreadIndex')
}; };
}, },
mounted: function() { mounted: function() {
@@ -1,11 +1,6 @@
<template name="sunui-upimg"> <template name="sunui-upimg">
<view class="sunui-uploader-bd"> <view class="sunui-uploader-bd">
<view class="sunui-uploader-files"> <view class="sunui-uploader-files">
<view
v-if="showBlankPlaceholder"
:style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'"
class="sunui-uploader-file"
/>
<block v-for="(item, index) in upload_before_list" :key="index"> <block v-for="(item, index) in upload_before_list" :key="index">
<view class="sunui-uploader-file" :class="[item.upload_percent < 100 ? 'sunui-uploader-file-status' : '']" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'"> <view class="sunui-uploader-file" :class="[item.upload_percent < 100 ? 'sunui-uploader-file-status' : '']" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'">
<image class="sunui-uploader-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="item.path" mode="aspectFill" @tap="preview(index)" v-if="type === 'image'" /> <image class="sunui-uploader-img" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'" :src="item.path" mode="aspectFill" @tap="preview(index)" v-if="type === 'image'" />
@@ -15,10 +10,7 @@
</view> </view>
</block> </block>
<view v-show="upload_before_list.length < upload_count" hover-class="sunui-uploader-hover" class="sunui-uploader-inputbox" @tap="choose" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'"> <view v-show="upload_before_list.length < upload_count" hover-class="sunui-uploader-hover" class="sunui-uploader-inputbox" @tap="choose" :style="'width:' + upload_img_wh + 'rpx; height:' + upload_img_wh + 'rpx;'">
<view :style="'line-height:'+ upload_img_wh + 'rpx;'"> <view :style="'line-height:'+ upload_img_wh + 'rpx;'"><text class="iconfont icon-mn_shangchuantupian" style="color: #666;"></text></view>
<text v-if="type === 'image'" class="iconfont icon-mn_shangchuantupian" style="color: #666;"></text>
<u-icon v-if="type === 'video'" size="48px" name="play-circle" style="color: #666;"></u-icon>
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -56,11 +48,6 @@ export default {
}, },
name: 'sunui-upimg', name: 'sunui-upimg',
props: { props: {
//
showBlankPlaceholder: {
type: Boolean,
default: false
},
upload_video_max: { upload_video_max: {
type: Number, type: Number,
default: 30 // (M) default: 30 // (M)
@@ -107,21 +94,6 @@ export default {
default: true default: true
} }
}, },
watch: {
dataList: {
handler(val) {
this.upload_before_list = val
this.upload_cache_list = []
if (val.length > 0) {
val.map(item => {
item && this.upload_cache_list.push(item.path)
})
}
this.emit()
},
immediate: true
}
},
onReady(res) { onReady(res) {
this.$nextTick(() => { this.$nextTick(() => {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
@@ -129,6 +101,40 @@ export default {
} }
}); });
}, },
created() {
},
mounted() {
},
watch: {
// url(val) {
// this.upload_before_list.map((item) => {
// this.upload_cache_list.push(item.path);
// });
// this.emit();
// }
dataList:{
handler(val){
console.log('dataList change'+JSON.stringify(val));
this.upload_before_list = val;
if(this.upload_before_list.length>0){
this.upload_cache_list = [];
this.upload_before_list.map((item) => {
//
if(item.path.substring(0,4) == 'http' && item.path.substring(0,11) != 'http://tmp/')
{
this.upload_cache_list.push(item.path);
}
});
}else{
this.upload_cache_list = [];
}
this.emit();
},
immediate: true
}
},
methods: { methods: {
videoPlay(e) { videoPlay(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
@@ -155,9 +161,9 @@ export default {
}); });
}); });
uni.showLoading({ /* uni.showLoading({
title: `正在上传...`, title: `正在上传...`,
}) }); */
Promise.all(promises).then((data) => { Promise.all(promises).then((data) => {
// uni.hideLoading(); // uni.hideLoading();
@@ -165,10 +171,9 @@ export default {
this.upload_cache_list.push(...data); this.upload_cache_list.push(...data);
console.log("after uploaded upload_cache_list:"+JSON.stringify(this.upload_cache_list)) console.log("after uploaded upload_cache_list:"+JSON.stringify(this.upload_cache_list))
this.emit(); this.emit();
uni.hideLoading()
}).catch((res) => { }).catch((res) => {
console.log(res); console.log(res);
uni.hideLoading() // uni.hideLoading();
}); });
}, },
choose() { choose() {
@@ -225,7 +230,7 @@ export default {
this.upload_exceeded_list.push(i === 0 ? 1 : i + 1); this.upload_exceeded_list.push(i === 0 ? 1 : i + 1);
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: `图片超出限制${this.upload_max}MB,已过滤`, content: `${[...new Set(this.upload_exceeded_list)].join(',')}图片超出限制${this.upload_max}MB,已过滤`,
showCancel: false, showCancel: false,
confirmText: '确认', confirmText: '确认',
success(res) { success(res) {
@@ -373,7 +378,7 @@ export default {
} }
.icon-mn_shangchuantupian { .icon-mn_shangchuantupian {
font-size: 48px; font-size: 3em;
} }
.sunui-uploader-img { .sunui-uploader-img {
@@ -392,7 +397,7 @@ export default {
.sunui-uploader-inputbox { .sunui-uploader-inputbox {
position: relative; position: relative;
margin: 0 16rpx 16rpx 0; margin-bottom: 16rpx;
box-sizing: border-box; box-sizing: border-box;
background-color: #ededed; background-color: #ededed;
display: flex; display: flex;
@@ -441,6 +446,7 @@ export default {
color: #fff; color: #fff;
z-index: 9; z-index: 9;
} }
.sunui-uploader-bd { .sunui-uploader-bd {
padding: 0; padding: 0;
margin: 0; margin: 0;
+1 -1
View File
@@ -216,7 +216,7 @@
<script> <script>
import CitySelect from "@/components/CitySelect"; import CitySelect from "@/components/CitySelect";
import tmUpload from '@/components/tm-upload/tm-upload.vue'; import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue';
import {getCity} from "@/api/user"; import {getCity} from "@/api/user";
import {chooseImage, isWeixin} from "@/utils"; import {chooseImage, isWeixin} from "@/utils";
import {getHomeData} from "@/api/public"; import {getHomeData} from "@/api/public";
+3 -1
View File
@@ -55,10 +55,12 @@ import {
getHotelGoodList getHotelGoodList
} from "@/api/inn.js"; } from "@/api/inn.js";
import imgBox from '@/components/imageTypeSet/imagebox.vue' import imgBox from '@/components/imageTypeSet/imagebox.vue'
import GooSkeleton from '@/components/GooSkeleton/index.vue'
export default { export default {
components: { components: {
imgBox imgBox,
GooSkeleton
}, },
data() { data() {
return { return {
+52 -127
View File
@@ -117,7 +117,7 @@
<view class="map-info-hd"> <view class="map-info-hd">
<image :src="webUrl + '/page/hotel/icon-location.png'" class="icon" /> <image :src="webUrl + '/page/hotel/icon-location.png'" class="icon" />
</view> </view>
<view class="map-info-bd more-t"> <view class="map-info-bd">
{{ inn.address }} {{ inn.address }}
</view> </view>
<view class="map-info-ft flex"> <view class="map-info-ft flex">
@@ -217,10 +217,10 @@
class="info-item-header" class="info-item-header"
@click="infoClick(item)" @click="infoClick(item)"
> >
<view class="name"> <view class="name one-t">
{{ item.name }} {{ item.name }}
</view> </view>
<view class="intro"> <view class="intro more-t">
{{ item.intro }} {{ item.intro }}
</view> </view>
</view> </view>
@@ -232,7 +232,6 @@
controls controls
play-btn-position="center" play-btn-position="center"
class="video-item" class="video-item"
@play="infoItemViewClick(item)"
/> />
</view> </view>
<view v-else> <view v-else>
@@ -241,7 +240,6 @@
:num="item.resources.length" :num="item.resources.length"
:img-radius="10" :img-radius="10"
style="width: 100%;" style="width: 100%;"
@click="infoItemViewClick(item)"
/> />
</view> </view>
</view> </view>
@@ -260,21 +258,21 @@
<view class="flex"> <view class="flex">
<image <image
v-if="!item.zanVo" v-if="!item.zanVo"
:src="webUrl + '/page/hotel/zan-off-2.png'" :src="webUrl + '/page/hotel/zan-off.png'"
class="zan-off-icon" class="zan-off-icon"
@click="likeInfoItemHandle(item, index, item.zan + 1, 1)" @click="likeInfoItemHandle(item, index, 1)"
/> />
<image <image
v-else v-else
:src="webUrl + '/page/hotel/zan-on-2.png'" :src="webUrl + '/page/hotel/zan-on.png'"
class="zan-on-icon" class="zan-on-icon"
@click="likeInfoItemHandle(item, index, item.zan -1, 0)" @click="likeInfoItemHandle(item, index, 0)"
/> />
<text <!-- <image
v-show="item.zan > 0" :src="webUrl + '/20230803151302213857.png'"
:class="item.zanVo ? 'on' : ''" class="icon"
class="seeNum-txt" />
>{{ item.zan }}</text> <text class="seeNum-txt">{{ item.zan }}</text> -->
</view> </view>
<view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)"> <view v-if="isMyInn" class="flex more-btn" @click="toggleMoreHandle(index)">
<image <image
@@ -302,7 +300,7 @@
@click="setTopInfoHandle(item, 0)" @click="setTopInfoHandle(item, 0)"
> >
<image <image
:src="webUrl + '/page/hotel/down.png'" :src="webUrl + '/page/hotel/delete.png'"
class="more-icon" class="more-icon"
/> />
取消置顶 取消置顶
@@ -423,22 +421,20 @@ import {
getHotelGoodList, getHotelGoodList,
postHotelNewsDel, postHotelNewsDel,
setTopHotelNew, setTopHotelNew,
getHotelNewsZan, getHotelNewsZan
getHotelShareBackgroundImage,
hotelNewsView
} from "@/api/inn.js" } from "@/api/inn.js"
import {formatDateTime} from "@/utils" import {formatDateTime} from "@/utils"
import {getUrlParam} from "@/utils/common.js" import {getUrlParam} from "@/utils/common.js"
import imgBox from '@/components/imageTypeSet/imagebox.vue' import imgBox from '@/components/imageTypeSet/imagebox.vue'
import cookie from "@/utils/store/cookie" import cookie from "@/utils/store/cookie"
import {addStore, removeStore} from "@/api/favorite" import {addStore, removeStore} from "@/api/favorite"
import { pageListenMixins } from '@/mixins/pageListenMixins' import GooSkeleton from '@/components/GooSkeleton/index.vue'
export default { export default {
components: { components: {
imgBox imgBox,
GooSkeleton
}, },
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
@@ -469,15 +465,13 @@ export default {
height: '500rpx' height: '500rpx'
}, },
tabList: [ tabList: [
{ text: '商品', value: 0, isShow: true }, { text: '精选商品', value: 0, isShow: true },
{ text: '资讯', value: 1, isShow: true }, { text: '最新资讯', value: 1, isShow: true },
{ text: '文化', value: 2, isShow: true }, { text: '企业文化', value: 2, isShow: true },
{ text: '资质', value: 3, isShow: true } { text: '商家资质', value: 3, isShow: true }
], ],
isLoadGoodListoSuccess: false, isLoadGoodListoSuccess: false,
isLoadInfoListSuccess: false, isLoadInfoListSuccess: false
pageKeyId: '',
shareImg: ''
} }
}, },
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -485,43 +479,8 @@ export default {
this.scrollData = e this.scrollData = e
}, },
onLoad(options) { onLoad(options) {
const id = options.id || '' if (options.id) {
const from = options.from this.id = options.id || null
switch (from) {
// 特产
case 'techan':
this.pageKeyId = `hotel_from_techan_hotelId_${id}`
break
// 千县
case 'famous':
this.pageKeyId = `hotel_from_famous_hotelId_${id}`
break
// 特色礼品
case 'gift':
this.pageKeyId = `hotel_from_gift_hotelId_${id}`
break
// 文玩
case 'wenwan':
this.pageKeyId = `hotel_from_wenwan_hotelId_${id}`
break
// 寻趣味
case 'fun':
this.pageKeyId = `hotel_from_findFun_hotelId_${id}`
break
// 养生圣地
case 'wellness':
this.pageKeyId = `hotel_from_wellnessPlace_hotelId_${id}`
break
// 民宿
case 'homestay':
this.pageKeyId = `product_from_countyFamous_productId_${id}`
break
default:
this.pageKeyId = `hotel_from_common_hotelId_${id}`
break
}
if (id) {
this.id = id || null
this.partnerId = options.partnerId || null this.partnerId = options.partnerId || null
} else { } else {
let obj = uni.getEnterOptionsSync() let obj = uni.getEnterOptionsSync()
@@ -542,27 +501,15 @@ export default {
this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px' this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px'
} }
}) })
getHotelShareBackgroundImage(this.id).then(res => {
const { success, data } = res
if (success) {
this.shareImg = data
}
})
},
onShareAppMessage() {
return {
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: this.shareImg
}
}, },
onShow() { onShow() {
if (!this.isLoad) { if (!this.isLoad) {
return return
} }
if (uni.getStorageSync('hotelInfoPublish') === '1') { if (this.inn.hasProduct > 0) {
this.fetchInnInfoList() this.fetchGoods()
} }
this.fetchInnInfoList()
this.fetchInnDetail() this.fetchInnDetail()
}, },
methods: { methods: {
@@ -658,18 +605,7 @@ export default {
}) })
}, },
infoClick: function (info) { infoClick: function (info) {
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
},
infoItemViewClick(item) {
uni.$u.debounce(() => {
hotelNewsView({ id: item.id }).finally(() => {
this.infoArray.map(info => {
if (info.id === item.id) {
info.pv += 1
}
})
})
}, 500)
}, },
publishBtnClick: function () { publishBtnClick: function () {
this.$yrouter.push('/pagesInn/inn/innInfoPublish?hotelId=' + this.inn.id) this.$yrouter.push('/pagesInn/inn/innInfoPublish?hotelId=' + this.inn.id)
@@ -721,7 +657,6 @@ export default {
_this.isLoadInfoListSuccess = false _this.isLoadInfoListSuccess = false
_this.loading = true _this.loading = true
_this.infoArray = [] _this.infoArray = []
uni.removeStorageSync('hotelInfoPublish')
getHotelNewsList({ getHotelNewsList({
page: 1, page: 1,
limit: 9999, limit: 9999,
@@ -753,21 +688,19 @@ export default {
reqFn(_this.id).then((res) => { reqFn(_this.id).then((res) => {
const { success, data } = res const { success, data } = res
if (success) { if (success) {
_this.isLoad = true
_this.inn = data _this.inn = data
_this.isLike = data.zanVo !== null _this.isLike = data.zanVo !== null
_this.isFavorite = data.hasFavorite _this.isFavorite = data.hasFavorite
_this.favoriteCount = data.favoriteCount _this.favoriteCount = data.favoriteCount
_this.inn.latitude = _this.inn.latitude > 0 ? _this.inn.latitude : 24.993587 _this.inn.latitude = _this.inn.latitude ? parseFloat(_this.inn.latitude) : 24.993587
_this.inn.longitude = _this.inn.longitude > 0 ? _this.inn.longitude : 102.779656 _this.inn.longitude = _this.inn.longitude ? parseFloat(_this.inn.longitude) : 102.779656
// fix bug#1107 // 该店铺无商品则不显示“精选商品”
if (!_this.isLoad) { if (data.hasProduct <= 0) {
// 该店铺无商品则不显示“精选商品” _this.activeIndex = 1
if (data.hasProduct <= 0) { _this.tabList[0].isShow = false
_this.activeIndex = 1 } else {
_this.tabList[0].isShow = false _this.fetchGoods()
} else {
_this.fetchGoods()
}
} }
// coverType: 1-图片,2-视频 // coverType: 1-图片,2-视频
if (data.coverType === 2) { if (data.coverType === 2) {
@@ -806,7 +739,6 @@ export default {
}) })
*/ */
} }
_this.isLoad = true
} }
}).finally(() => { }).finally(() => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
@@ -840,6 +772,7 @@ export default {
this.fetchInnInfoList() this.fetchInnInfoList()
break break
case 0: case 0:
this.goodsList = []
this.fetchGoods() this.fetchGoods()
break break
default: default:
@@ -848,7 +781,6 @@ export default {
}, },
fetchGoods() { fetchGoods() {
this.isLoadGoodListoSuccess = false this.isLoadGoodListoSuccess = false
this.goodsList = []
getHotelGoodList({ getHotelGoodList({
id: this.inn.id, id: this.inn.id,
page: 1, page: 1,
@@ -925,20 +857,18 @@ export default {
this.fetchInnInfoList() this.fetchInnInfoList()
} }
}).catch(() => { }).catch(() => {
setTimeout(() => { uni.hideLoading()
uni.hideLoading()
}, 3000)
}) })
}, },
likeInfoItemHandle(item, index, value, voValue) { likeInfoItemHandle(item, index, value) {
getHotelNewsZan(item.id).then(res => { getHotelNewsZan(item.id).then(res => {
const { success } = res const { success } = res
if (success) { if (success) {
this.$dialog.toast({ this.$dialog.toast({
mes: '操作成功!' mes: '操作成功!'
}) })
this.$set(this.infoArray[index], 'zan', value) this.$set(this.infoArray[index], 'zanVo', value)
this.$set(this.infoArray[index], 'zanVo', voValue) // this.fetchInnInfoList()
} }
}) })
} }
@@ -1098,7 +1028,7 @@ export default {
z-index: 1; z-index: 1;
.bg-color { .bg-color {
position: absolute; position: absolute;
top: -5px; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 1; z-index: 1;
@@ -1273,7 +1203,7 @@ export default {
z-index: 5; z-index: 5;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 40rpx 10rpx 40rpx 32rpx; padding: 40rpx 32rpx;
color: #333; color: #333;
font-size: 14px; font-size: 14px;
.map-info-hd { .map-info-hd {
@@ -1290,16 +1220,16 @@ export default {
} }
.map-info-ft { .map-info-ft {
.item + .item { .item + .item {
margin: 0 0 0 6rpx; margin: 0 0 0 36rpx;
} }
.item { .item {
text-align: center; text-align: center;
font-weight: 500; font-weight: bold;
.img { .img {
display: block; display: block;
width: 96rpx; width: 72rpx;
height: 96rpx; height: 72rpx;
margin: 0 0 -16rpx 0; margin: 0 0 20rpx 0;
} }
} }
} }
@@ -1388,18 +1318,13 @@ export default {
margin: 0 8rpx 0 0; margin: 0 8rpx 0 0;
} }
.zan-off-icon { .zan-off-icon {
width: 40rpx; width: 138rpx;
height: 40rpx; height: 40rpx;
} }
.zan-on-icon { .zan-on-icon {
width: 40rpx; width: 80rpx;
height: 40rpx; height: 40rpx;
} }
.seeNum-txt {
&.on {
color: #D81E06;
}
}
.more-btn { .more-btn {
position: relative; position: relative;
.more-wrapper { .more-wrapper {
@@ -1437,6 +1362,6 @@ export default {
text-align: center; text-align: center;
font-size: 32rpx; font-size: 32rpx;
color: #999; color: #999;
line-height: 200rpx; line-height: 80rpx;
} }
</style> </style>
+9 -11
View File
@@ -44,7 +44,6 @@
@change="uploadedImgChange" @change="uploadedImgChange"
/> />
</view> </view>
<!--
<view class="form-item"> <view class="form-item">
<view class="title">资讯详情:</view> <view class="title">资讯详情:</view>
<view class="inp"> <view class="inp">
@@ -56,7 +55,6 @@
/> />
</view> </view>
</view> </view>
-->
<view class="form-btn"> <view class="form-btn">
<button form-type="submit">发布</button> <button form-type="submit">发布</button>
</view> </view>
@@ -65,7 +63,8 @@
</template> </template>
<script> <script>
import tmUpload from '@/components/tm-upload/tm-upload.vue' import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
import jinEdit from '@/pagesInn/components/jin-edit/jin-edit.vue'
import { import {
VUE_APP_API_URL VUE_APP_API_URL
} from '@/config' } from '@/config'
@@ -74,7 +73,8 @@
} from '@/api/inn.js' } from '@/api/inn.js'
export default { export default {
components: { components: {
tmUpload tmUpload,
jinEdit
}, },
data() { data() {
return { return {
@@ -129,7 +129,7 @@
}, },
//文件上传结果 //文件上传结果
uploadedImgChange: function(uploadedFilesList) { uploadedImgChange: function(uploadedFilesList) {
this.uploadedFilesArray = uploadedFilesList this.uploadedFilesArray = uploadedFilesList;
}, },
formSubmit(e) { formSubmit(e) {
if (!this.form.title) { if (!this.form.title) {
@@ -140,10 +140,10 @@
this.$dialog.error('请输入简介') this.$dialog.error('请输入简介')
return return
} }
// if (!this.form.content) { if (!this.form.content) {
// this.$dialog.error('请输入资讯详情') this.$dialog.error('请输入资讯详情')
// return return
// } }
if (this.uploadedFilesArray.length == 0) { if (this.uploadedFilesArray.length == 0) {
this.$dialog.error('请上传动态图片或视频') this.$dialog.error('请上传动态图片或视频')
return return
@@ -162,8 +162,6 @@
this.$dialog.toast({ this.$dialog.toast({
mes: '发布成功!' mes: '发布成功!'
}) })
// 写入缓存,返回至商户主页时监听用于刷新资讯列表
uni.setStorageSync('hotelInfoPublish', '1')
setTimeout(() => { setTimeout(() => {
this.$yrouter.back() this.$yrouter.back()
}, 3000) }, 3000)
+24 -119
View File
@@ -34,30 +34,6 @@
</view> </view>
<text class="iconfont icon-jiantou"></text> <text class="iconfont icon-jiantou"></text>
</view> </view>
<view class="item is_required">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">封面类型</view>
<view>
<u-radio-group
v-model="innApplyInfo.coverType"
placement="row"
>
<u-radio
:name="1"
:customStyle="{marginRight: '16px'}"
active-color="red"
label="图片"
/>
<u-radio
:name="2"
active-color="red"
label="视频"
/>
</u-radio-group>
</view>
</view>
<text class="iconfont icon-jiantou"></text>
</view>
<view v-if="innApplyInfo.coverType === 1" class="item is_required" @click="chooseCoverImg()"> <view v-if="innApplyInfo.coverType === 1" class="item is_required" @click="chooseCoverImg()">
<view class="cell acea-row row-between row-middle"> <view class="cell acea-row row-between row-middle">
<view class="cell-title">封面照片</view> <view class="cell-title">封面照片</view>
@@ -136,15 +112,7 @@
</view> </view>
</view> </view>
</view> --> </view> -->
<view class="item is_required"> <view class="item">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">
店铺图片
<text class="txt">最多上传9张图片</text>
</view>
</view>
</view>
<view v-if="picsArray.length > 0" class="item">
<view class="img-upload"> <view class="img-upload">
<tm-upload <tm-upload
:dataList="picsArray" :dataList="picsArray"
@@ -156,26 +124,6 @@
/> />
</view> </view>
</view> </view>
<view class="item is_required">
<view class="cell acea-row row-between row-middle">
<view class="cell-title">
店铺资质
<text class="txt">最多上传9张图片</text>
</view>
</view>
</view>
<view v-if="picsArray.length > 0" class="item">
<view class="img-upload">
<tm-upload
:dataList="qualificationsArray"
:upload_img_wh="(750 - 3 * 16 - 2 * 32) / 3.0"
:upload_max="10"
:url="uploadUrl"
:header="uploadHeader"
@change="uploadedImg2Change"
/>
</view>
</view>
</view> </view>
<view class="submit-btn" @tap="submit">确定修改</view> <view class="submit-btn" @tap="submit">确定修改</view>
</view> </view>
@@ -183,7 +131,7 @@
<script> <script>
import CitySelect from '@/components/CitySelect' import CitySelect from '@/components/CitySelect'
import tmUpload from '@/components/tm-upload/tm-upload.vue' import tmUpload from '@/pagesInn/components/tm-upload/tm-upload.vue'
import { import {
chooseImage, chooseImage,
chooseVideoToUpload chooseVideoToUpload
@@ -204,12 +152,10 @@ export default {
}, },
innHistory: {}, // 历史信息 innHistory: {}, // 历史信息
picsArray: [], picsArray: [],
qualificationsArray: [],
typeList: [], // 类型列表 typeList: [], // 类型列表
typeIndex: 0, // 选中的类型 typeIndex: 0, // 选中的类型
typeRange: [], // 类型数据源 typeRange: [], // 类型数据源
uploadedFilesArray: [], uploadedFilesArray: [],
uploadedQualificationFilesArray: [],
innApplyInfo: { innApplyInfo: {
'address': '', 'address': '',
'areaId': 0, 'areaId': 0,
@@ -223,14 +169,12 @@ export default {
'name': '', 'name': '',
'ownerName': '', 'ownerName': '',
'pics': [], 'pics': [],
'qualification': [],
'position': '', 'position': '',
'tel': '', 'tel': '',
'qrcode': '', 'qrcode': '',
'tips': '', 'tips': '',
'type': '' 'type': ''
}, }
loading: false
} }
}, },
onShow() { onShow() {
@@ -241,7 +185,6 @@ export default {
if (id) { if (id) {
// 赋值 // 赋值
const hotel = JSON.parse(uni.getStorageSync('MY_HOTEL_INFO')) const hotel = JSON.parse(uni.getStorageSync('MY_HOTEL_INFO'))
console.log(hotel)
this.innHistory = hotel this.innHistory = hotel
this.fillData(this.innApplyInfo, this.innHistory) this.fillData(this.innApplyInfo, this.innHistory)
if (hotel.coverType === 2) { if (hotel.coverType === 2) {
@@ -249,25 +192,13 @@ export default {
} else { } else {
this.innApplyInfo.coverVideo = '' this.innApplyInfo.coverVideo = ''
} }
// 店铺图片 // 图片填充
this.picsArray = hotel.pics.map(item => { this.picsArray = hotel.pics.map(function (item) {
return { return {
path: item, path: item,
upload_percent: 100 upload_percent: 100
} }
}) })
this.uploadedFilesArray = hotel.pics || []
// 资质
const uploadedQualificationFilesArray = []
this.qualificationsArray = hotel.qualifications.map(item => {
const image = item.image || ''
uploadedQualificationFilesArray.push(image)
return {
path: item.image,
upload_percent: 100
}
})
this.uploadedQualificationFilesArray = uploadedQualificationFilesArray
} }
}, },
methods: { methods: {
@@ -305,10 +236,6 @@ export default {
uploadedImgChange: function (uploadedFilesList) { uploadedImgChange: function (uploadedFilesList) {
this.uploadedFilesArray = uploadedFilesList this.uploadedFilesArray = uploadedFilesList
}, },
// 文件上传结果
uploadedImg2Change: function (uploadedFilesList) {
this.uploadedQualificationFilesArray = uploadedFilesList
},
chooseQrcodeImg() { chooseQrcodeImg() {
chooseImage(img => { chooseImage(img => {
this.$set(this.innApplyInfo, 'qrcode', img) this.$set(this.innApplyInfo, 'qrcode', img)
@@ -322,7 +249,6 @@ export default {
chooseLogoVideo() { chooseLogoVideo() {
chooseVideoToUpload(path => { chooseVideoToUpload(path => {
this.$set(this.innApplyInfo, 'coverVideo', path) this.$set(this.innApplyInfo, 'coverVideo', path)
this.$forceUpdate()
}) })
}, },
chooseCoverImg() { chooseCoverImg() {
@@ -331,44 +257,32 @@ export default {
}) })
}, },
submit() { submit() {
const suffixs = ['.png', '.jpg', '.jpeg', '.bmp', '.gif', '.webp', '.psd', '.svg', '.tiff'] if (this.innApplyInfo.logo.length === 0) {
const suffix = this.innApplyInfo.cover ? this.innApplyInfo.cover.substring(this.innApplyInfo.cover.lastIndexOf(".")) : ''; this.$dialog.error('请上传店铺LOGO图片')
const isImg = suffixs.indexOf(suffix.toLowerCase()) > -1
console.log(suffix);
if(this.loading) {
return return
} }
if (!this.innApplyInfo.logo) { if (this.innApplyInfo.cover.length === 0 && this.innApplyInfo.coverType === 1) {
this.$dialog.error('请上传店铺LOGO')
return
}
if (!isImg && this.innApplyInfo.coverType === 1) {
this.$dialog.error('请上传店铺封面图片') this.$dialog.error('请上传店铺封面图片')
return return
} }
if (!this.innApplyInfo.coverVideo && this.innApplyInfo.coverType === 2) { if (this.innApplyInfo.coverVideo.length === 0 && this.innApplyInfo.coverType === 2) {
this.$dialog.error('请上传店铺封面视频') this.$dialog.error('请上传店铺封面视频')
return return
} }
if (!this.innApplyInfo.ownerName) { if (this.innApplyInfo.ownerName.length === 0) {
this.$dialog.error('请输入店主名字') this.$dialog.error('请输入店主名字')
return return
} }
if (!this.innApplyInfo.content) { if (this.innApplyInfo.content.length === 0) {
this.$dialog.error('请输入一句话介绍') this.$dialog.error('请输入一句话介绍')
return return
} }
// if (!this.innApplyInfo.desc) { if (this.innApplyInfo.desc.length === 0) {
// this.$dialog.error('请输入店铺简介') this.$dialog.error('请输入店铺简介')
// return
// }
if (this.uploadedFilesArray.length === 0) {
this.$dialog.error('请上传店铺图片')
return return
} }
if (this.uploadedQualificationFilesArray.length === 0) { if (this.uploadedFilesArray.length === 0) {
this.$dialog.error('请上传资质图片') this.$dialog.error('请上传至少一张店铺图片')
return return
} }
// 深拷贝 // 深拷贝
@@ -376,27 +290,23 @@ export default {
if (this.uploadedFilesArray.length > 0) { if (this.uploadedFilesArray.length > 0) {
param.pics = this.uploadedFilesArray.join(',') param.pics = this.uploadedFilesArray.join(',')
} }
param.qualification = this.uploadedQualificationFilesArray
param.id = this.innHistory.id param.id = this.innHistory.id
if (param.coverType === 2) { if (param.coverType === 2) {
param.cover = param.coverVideo param.cover = param.coverVideo
} }
this.loading = true
uni.showLoading() uni.showLoading()
postHotelInfoEdit(param).then((res) => { postHotelInfoEdit(param).then((res) => {
uni.hideLoading() uni.hideLoading()
uni.showModal({ uni.showToast({
title: '提示', title: '修改成功!',
content: '修改成功!', mask: false,
showCancel: false, duration: 1500
success: () => {
this.loading = false
uni.navigateBack()
}
}) })
setTimeout(function () {
uni.navigateBack()
}, 1000)
}).catch((err) => { }).catch((err) => {
uni.hideLoading() uni.hideLoading()
this.loading = false
uni.showToast({ uni.showToast({
title: err.msg + '', title: err.msg + '',
icon: 'none', icon: 'none',
@@ -419,8 +329,8 @@ export default {
height: 64rpx; height: 64rpx;
} }
.video-item { .video-item {
width: 120rpx; width: 64rpx;
height: 120rpx; height: 64rpx;
} }
.inp-textarea { .inp-textarea {
width: 100%; width: 100%;
@@ -494,11 +404,6 @@ export default {
flex-shrink: 0; flex-shrink: 0;
margin-right: 10rpx; margin-right: 10rpx;
} }
.base-info-section .item.is_required .cell .cell-title .txt {
margin: 0 0 0 8px;
color: red;
font-size: 22rpx;
}
.base-info-section .item.is_required .cell .cell-value { .base-info-section .item.is_required .cell .cell-value {
flex-grow: 1; flex-grow: 1;
+6 -9
View File
@@ -37,17 +37,14 @@
</template> </template>
<script> <script>
import {getLogs, takePrize} from '@/api/lottery' import {getLogs, takePrize} from "@/api/lottery";
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins],
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
loading: false, loading: false,
page: 1, page: 1,
list: [], list: []
pageKeyId: Object.freeze('lotteryRecords')
} }
}, },
onShow() { onShow() {
@@ -83,7 +80,7 @@ export default {
this.page++ this.page++
this.fetchList() this.fetchList()
}, },
async takeItem(item, index) { async takeItem(item) {
// 领取商品 // 领取商品
if (item['prizeType'] === 1 && item['status'] === 1) { if (item['prizeType'] === 1 && item['status'] === 1) {
uni.navigateTo({ uni.navigateTo({
@@ -101,15 +98,15 @@ export default {
confirmText: '查看订单', confirmText: '查看订单',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定') console.log('用户点击确定');
uni.navigateTo({ uni.navigateTo({
url: '/pages/order/MyOrder/index' url: '/pages/order/MyOrder/index'
}) })
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消');
} }
} }
}) });
} }
} }
} }
+2 -16
View File
@@ -80,13 +80,11 @@
</template> </template>
<script> <script>
import { getDetail, getPrize, takePrize, getLotteryShareInfo } from '@/api/lottery' import { getDetail, getPrize, takePrize } from '@/api/lottery'
import gbroMarquee from '../components/gbro-marquee/marquee.vue' import gbroMarquee from '../components/gbro-marquee/marquee.vue'
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
components: { gbroMarquee }, components: { gbroMarquee },
mixins: [pageListenMixins],
data() { data() {
return { return {
ready: false, ready: false,
@@ -115,9 +113,7 @@ export default {
text_color: "#333", //字体颜色 text_color: "#333", //字体颜色
back_color: "red", //背景色 back_color: "red", //背景色
}, },
imgData: [], imgData: []
shareAppImg: '',
pageKeyId: Object.freeze('lotteryIndex')
} }
}, },
computed: { computed: {
@@ -130,13 +126,6 @@ export default {
onLoad() { onLoad() {
this.init() this.init()
}, },
onShareAppMessage() {
return {
title: '探寻有趣有味的生活方式',
path: '/pkg-video/views/lottery',
imageUrl: this.shareAppImg
}
},
methods: { methods: {
init() { init() {
getDetail().then(res => { getDetail().then(res => {
@@ -149,9 +138,6 @@ export default {
},1000) },1000)
} }
}) })
getLotteryShareInfo().then(res => {
this.shareAppImg = res.data || ''
})
}, },
onSubmit() { onSubmit() {
+3 -7
View File
@@ -3,19 +3,15 @@
</template> </template>
<script> <script>
import { pageListenMixins } from '@/mixins/pageListenMixins'
export default { export default {
mixins: [pageListenMixins], name: "pdf",
name: 'PdfView',
data() { data() {
return { return {
pdfPath: '', pdfPath: ""
pageKeyId: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.pageKeyId = `investmentInfo_id_${options.id}` this.pdfPath = options.path;
this.pdfPath = options.path
} }
} }
</script> </script>
+31 -94
View File
@@ -13,7 +13,6 @@
<view class="msg" v-if="item.msg_type===1"> <view class="msg" v-if="item.msg_type===1">
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image> <image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image>
</view> </view>
</view> </view>
</view> </view>
@@ -24,78 +23,33 @@
<view class="msg" v-if="item.msg_type===1"> <view class="msg" v-if="item.msg_type===1">
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image> <image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image>
</view> </view>
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2">
<view class="goods-logo">
<image class="img v12-radius-8" :src="wsJson(item.msg_content).cover"></image>
</view>
<view class="conent v12-ml-3 v12-justify-between v12-flex-column">
<view class="">
<view class="goodsName one-t v12-font-26">
{{ wsJson(item.msg_content).goodsName }}
</view>
<view class="goodsSku v12-secondary-dark-text v12-font-22 v12-font-weight-400 one-t">
{{ wsJson(item.msg_content).skuStr }}
</view>
</view>
<view class="price v12-primary-text v12-font-24">
{{ wsJson(item.msg_content).price }}
</view>
</view>
</view>
</view> </view>
<image class="cover" :src="item.header || webUrl+'/20221114155314348118.png'"/> <image class="cover" :src="item.header || webUrl+'/20221114155314348118.png'"/>
</view> </view>
</view>
<view class="msg v12-d-flex goods-link" style="box-sizing: content-box" v-if="params" @click="sendGoods">
<view class="goods-logo">
<image class="img v12-radius-8" :src="params.cover"></image>
</view>
<view class="conent v12-ml-3 v12-justify-between v12-flex-column">
<view class="">
<view class="goodsName one-t v12-font-26">
{{ params.goodsName }}
</view>
<view class="goodsSku v12-secondary-dark-text v12-font-22 v12-font-weight-400 one-t">
{{ params.skuStr }}
</view>
</view>
<view class="price v12-primary-text v12-font-24">
{{ params.price }}
</view>
</view>
</view> </view>
</view> </view>
<view class="footer flex jc-between ai-end v12-align-center"> <view class="footer flex jc-between ai-end">
<image :src="webUrl+'/20221014095236624035.png'" @click="getUploadToken"></image> <image :src="webUrl+'/20221014095236624035.png'" @click="getUploadToken"></image>
<view class="input-box"> <view class="input-box">
<textarea <textarea v-model="content" maxlength="150" :auto-height="true" :fixed="true" confirm-type="send"
v-model="content" @input="userInput" @confirm="userSend"/>
maxlength="150"
:auto-height="true"
:fixed="true"
:show-confirm-bar="false"
confirm-type="send"
@input="userInput"
@confirm="userSend"
cursor-spacing="15"
:adjust-position="true"
/>
</view> </view>
<button @click="userSend" class="v12-primary">发送</button> <button @click="userSend">发送</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {userUnionId} from "@/api/public";
export default { export default {
name: "room", name: "room",
data() { data() {
return { return {
webUrl: this.$VUE_APP_RESOURCES_URL, webUrl: this.$VUE_APP_RESOURCES_URL,
token: null, token: null,
uid: null, unionId: null,
userInfo: null, userInfo: null,
storeId: null, storeId: null,
merName: null, merName: null,
@@ -107,17 +61,12 @@ export default {
roomId: null, //房间ID roomId: null, //房间ID
content: "", //消息内容 content: "", //消息内容
list: [], //消息列表, list: [], //消息列表
params: null
} }
}, },
onLoad(options) { onLoad(options) {
this.storeId = options.id; this.storeId = options.id;
this.merName = options.name; this.merName = options.name;
this.params = options.params && JSON.parse(options.params) || null
setTimeout(()=>{
this.params = null
}, 10000)
if (this.merName!="undefined" && this.merName!="null") { if (this.merName!="undefined" && this.merName!="null") {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.merName title: this.merName
@@ -125,8 +74,7 @@ export default {
} }
this.token = uni.getStorageSync("login_status"); this.token = uni.getStorageSync("login_status");
this.userInfo = uni.getStorageSync("userInfo"); this.userInfo = uni.getStorageSync("userInfo");
this.uid = this.userInfo.uid this.getUnionId();
this.connectSocketInit()
}, },
onUnload() { onUnload() {
if (this.socketOpen) { if (this.socketOpen) {
@@ -134,9 +82,15 @@ export default {
} }
}, },
methods: { methods: {
wsJson(json) { getUnionId() {
return JSON.parse(json) userUnionId().then(res => {
if (res.success) {
this.unionId = res.data;
this.connectSocketInit();
}
});
}, },
getUploadToken() { getUploadToken() {
let that = this; let that = this;
@@ -174,7 +128,7 @@ export default {
let param = { let param = {
type: "msg", type: "msg",
user_type: 0, user_type: 0,
uid: that.uid, unionid: that.unionId,
username: that.userInfo.nickname, username: that.userInfo.nickname,
header: that.userInfo.avatar, header: that.userInfo.avatar,
room_id: that.roomId, room_id: that.roomId,
@@ -192,14 +146,7 @@ export default {
} }
}) })
}, },
sendGoods() {
if(Object.values(this.params).length > 0) {
this.content = JSON.stringify(this.params)
// this.list.push(this.params)
this.userSend(2)
}
this.params = null
},
// 预览图片 // 预览图片
preview(url) { preview(url) {
uni.previewImage({ uni.previewImage({
@@ -220,7 +167,6 @@ export default {
console.log('WebSocket连接已打开!', res); console.log('WebSocket连接已打开!', res);
this.socketOpen = true; this.socketOpen = true;
this.createRoom(); this.createRoom();
}); });
uni.onSocketError(err => { uni.onSocketError(err => {
@@ -241,17 +187,17 @@ export default {
this.content = event.detail.value; this.content = event.detail.value;
}, },
userSend(msg_type) { userSend() {
if (this.content.length === 0) return; if (this.content.length === 0) return;
let param = { let param = {
type: "msg", type: "msg",
user_type: 0, user_type: 0,
uid: this.uid, unionid: this.unionId,
username: this.userInfo.nickname, username: this.userInfo.nickname,
header: this.userInfo.avatar, header: this.userInfo.avatar,
room_id: this.roomId, room_id: this.roomId,
msg_type: msg_type === 2 ? msg_type : 0, msg_type: 0,
content: this.content, content: this.content,
token: this.token token: this.token
} }
@@ -260,11 +206,10 @@ export default {
}, },
createRoom() { createRoom() {
let param = { let param = {
type: "join", type: "join",
user_type: 0, user_type: 0,
uid: this.uid, unionid: this.unionId,
username: this.userInfo.nickname, username: this.userInfo.nickname,
header: this.userInfo.avatar, header: this.userInfo.avatar,
store_id: this.storeId store_id: this.storeId
@@ -322,15 +267,6 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.goods-link{
box-sizing: content-box;
position: fixed;
bottom: 200rpx;
right: 20rpx;
}
.goodsName,.goodsSku{
max-width: 400rpx;
}
.common-room { .common-room {
min-height: 100vh; min-height: 100vh;
background: #F5F5F5; background: #F5F5F5;
@@ -343,7 +279,7 @@ export default {
} }
.main { .main {
padding: 0 32rpx 160rpx; padding: 0 32rpx 130rpx;
.datetime { .datetime {
margin: 30rpx 0; margin: 30rpx 0;
@@ -380,8 +316,8 @@ export default {
word-wrap: break-word; word-wrap: break-word;
.img { .img {
max-width: 140rpx; max-width: 214rpx;
max-height: 140rpx; max-height: 214rpx;
vertical-align: middle; vertical-align: middle;
} }
} }
@@ -400,9 +336,9 @@ export default {
bottom: 0; bottom: 0;
width: 100vw; width: 100vw;
padding: 30rpx 32rpx 28rpx; padding: 30rpx 32rpx 28rpx;
border-radius: 40rpx 40rpx 0rpx 0rpx; border-radius: 24rpx 24rpx 0 0;
background: #FFFFFF; background: #FFFFFF;
height: 160rpx;
image { image {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
@@ -425,8 +361,9 @@ export default {
button { button {
width: 120rpx; width: 120rpx;
height: 64rpx;
margin: 0; margin: 0;
border-radius: 100rpx; border-radius: 32rpx;
background: #FD574B; background: #FD574B;
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;

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