游梦婷 2 years ago
commit 9188e7411a
  1. 75
      App.vue
  2. 4
      Utils/Api.js
  3. 90
      Utils/physicalObject.js
  4. 154
      components/dataList/dataList.vue
  5. 162
      components/pick-regions/pick-regions.vue
  6. 34
      components/wuliuPupup/wuliuPupup.vue
  7. 9
      manifest.json
  8. 66
      pages.json
  9. 596
      pages/address/addNewAddress/addNewAddress.vue
  10. 18496
      pages/address/addNewAddress/address.json
  11. 171
      pages/address/addNewAddress/addressPicker.vue
  12. 350
      pages/address/addNewAddress/demo.vue
  13. 125
      pages/address/address.vue
  14. 105
      pages/classify/cart-choose/cart-choose.vue
  15. 264
      pages/classify/cart/cart.vue
  16. 574
      pages/classify/goods-list/goods-list.vue
  17. 80
      pages/classify/goods-search/goods-search.vue
  18. 202
      pages/classify/goodsDetail/goodsDetail.vue
  19. 4
      pages/goods/externalCoupon/externalCoupon.vue
  20. 8
      pages/settleAccounts/settleAccounts.vue
  21. 206
      pages/tabBar/classify/classify.vue
  22. 11733
      pages/tabBar/classify/data.json
  23. 582
      pages/tabBar/classify/data2.json
  24. 93
      pages/tabBar/home/home.vue
  25. 8
      pages/tabBar/user/user.vue
  26. 10
      pages/user/payActivity/payActivity.vue
  27. 73
      pages/welcome/welcome.vue
  28. BIN
      qianzhu-KFC/static/imgs/kfc1.png
  29. BIN
      qianzhu-KFC/static/imgs/kfc2.png
  30. 37
      subPages/recharge-centre/recharge-centre.vue
  31. 4
      subPages/recharge/recharge.vue
  32. 97
      subPages/shareCounpon/shareCounpon.vue
  33. 8
      subPages/shareImgage/shareImgage.vue
  34. BIN
      subPages/static/union1.jpg
  35. BIN
      subPages/static/union2.jpg
  36. BIN
      subPages/static/upay1.jpg
  37. BIN
      subPages/static/upay2.jpg
  38. BIN
      subPages/static/upay4.jpg
  39. 2
      subPages/unionComfirmation/unionComfirmation.vue

@ -65,7 +65,9 @@
//
pelletoilList: '',
//
shareNum:0
shareNum:0,
//
cartNum:0,
},
onLaunch: function() {},
@ -73,18 +75,18 @@
// #ifdef MP
let accountInfo = uni.getAccountInfoSync();
// if (accountInfo.miniProgram.envVersion == 'develop' || accountInfo.miniProgram.envVersion == 'trial') {
// this.globalData.url = 'https://hsgcs.dctpay.com/crest';
// this.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
// this.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
// this.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
// this.globalData.userurl = 'https://hsgcs.dctpay.com/user';
// this.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
// this.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
// this.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
// this.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
// }
// if (accountInfo.miniProgram.envVersion == 'release') {
if (accountInfo.miniProgram.envVersion == 'develop' || accountInfo.miniProgram.envVersion == 'trial') {
this.globalData.url = 'https://hsgcs.dctpay.com/crest';
this.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
this.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
this.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
this.globalData.userurl = 'https://hsgcs.dctpay.com/user';
this.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
this.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
this.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
this.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
}
if (accountInfo.miniProgram.envVersion == 'release') {
this.globalData.url = 'https://hsg.dctpay.com/crest';
this.globalData.v1url = 'https://hsg.dctpay.com/v1';
this.globalData.payurl = 'https://pay.dctpay.com/crest';
@ -94,29 +96,29 @@
this.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/';
this.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/';
this.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/';
// }
}
// #endif
// #ifdef H5
let that = this;
// that.globalData.url = 'https://hsgcs.dctpay.com/crest';
// that.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
// that.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
// that.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
// that.globalData.userurl = 'https://hsgcs.dctpay.com/user';
// that.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
// that.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
// that.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
// that.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
that.globalData.url = 'https://hsgcs.dctpay.com/crest';
that.globalData.v1url = 'https://hsgcs.dctpay.com/v1';
that.globalData.payurl = 'https://gratia-pay.dctpay.com/crest';
that.globalData.orderurl = 'https://hsgcs.dctpay.com/order';
that.globalData.userurl = 'https://hsgcs.dctpay.com/user';
that.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest';
that.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/';
that.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/';
that.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/';
that.globalData.url = 'https://hsg.dctpay.com/crest';
that.globalData.v1url = 'https://hsg.dctpay.com/v1';
that.globalData.payurl = 'https://pay.dctpay.com/crest';
that.globalData.orderurl = 'https://hsg.dctpay.com/order';
that.globalData.userurl = 'https://hsg.dctpay.com/user';
that.globalData.brestUrl = 'https://hsg.dctpay.com/brest';
that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/';
that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/';
that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/';
// that.globalData.url = 'https://hsg.dctpay.com/crest';
// that.globalData.v1url = 'https://hsg.dctpay.com/v1';
// that.globalData.payurl = 'https://pay.dctpay.com/crest';
// that.globalData.orderurl = 'https://hsg.dctpay.com/order';
// that.globalData.userurl = 'https://hsg.dctpay.com/user';
// that.globalData.brestUrl = 'https://hsg.dctpay.com/brest';
// that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/';
// that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/';
// that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/';
uni.getStorage({
key: 'openId',
success(e) {
@ -229,6 +231,15 @@
}
}
})
uni.getStorage({
key: 'cartNum',
success(e) {
if (e.data) {
that.globalData.cartNum = e.data;
console.log(that.globalData.cartNum,"getStorage")
}
}
})
// #endif
},
onHide: function() {}

@ -704,11 +704,11 @@ export const payReceiveDiscount = params => {
}
//获取二维码
export const generateWeChatMpQrCode = params => {
return POST('POST', `${payBase}/storeDiscountActivityPartakeUser/generateWeChatMpQrCode`, params).then(res => res.data);
return POST('GET', `${payBase}/storeDiscountActivityPartakeUser/generateWeChatMpQrCode`, params).then(res => res.data);
}
//查询订单详情
export const getOrderByOutTradeOrder = params => {
return POST('POST', `${payBase}/tradeOrder/getOrderByOutTradeOrder`, params).then(res => res.data);
return POST('GET', `${payBase}/tradeOrder/getOrderByOutTradeOrder`, params).then(res => res.data);
}

@ -0,0 +1,90 @@
import {
POST
} from "./Request.js";
let app = getApp();
let base = app.globalData.url;
// let orderbase = app.globalData.orderurl;
// let userbase = app.globalData.userurl;
// let v1base = app.globalData.v1url;
// let brestBase = app.globalData.brestUrl;
// let payBase = app.globalData.payurl;
// 查询分类树
export const getGoodsTypeTree = params => {
return POST('GET', `${base}/goods/getGoodsTypeTree`, params).then(res => res.data);
}
// 查询商品列表
export const getListGoodsDetail = params => {
return POST('GET', `${base}/goods/getListGoodsDetail`, params).then(res => res.data);
}
//根据商品id查询商品详情
export const findGoodsDetailById = params => {
return POST('GET', `${base}/goods/findGoodsDetailById`, params).then(res => res.data);
}
// 查询商品规格
export const findGoodsSkuByGoodsId = params => {
return POST('GET', `${base}/goods/findGoodsSkuByGoodsId`, params).then(res => res.data);
}
// 新增购物车内容
export const insertShoppingCart = params => {
return POST('POST', `${base}/shoppingCart/insertShoppingCart`, params).then(res => res.data);
}
// 增加商品数量
export const goodsAddNum = params => {
return POST('GET', `${base}/shoppingCart/goodsAddNum`, params).then(res => res.data);
}
// 删除购物车商品
export const deleteShoppingCart = params => {
return POST('GET', `${base}/shoppingCart/deleteShoppingCart`, params).then(res => res.data);
}
// 查询购物车列表
export const getShoppingCartList = params => {
return POST('GET', `${base}/shoppingCart/getShoppingCartList`, params).then(res => res.data);
}
// 查询区域列表
export const getRegional = params => {
return POST('GET', `${base}/common/getRegional`, params).then(res => res.data);
}
// 新增收获地址
export const insertDeliveryAddress = params => {
return POST('POST', `${base}/deliveryAddress/insertDeliveryAddress`, params).then(res => res.data);
}
// 更新收货地址
export const updateDeliveryAddress = params => {
return POST('POST', `${base}/deliveryAddress/updateDeliveryAddress`, params).then(res => res.data);
}
// 查询收货地址列表
export const getDeliveryAddressList = params => {
return POST('GET', `${base}/deliveryAddress/getDeliveryAddressList`, params).then(res => res.data);
}
// 根据id 查询收货地址详情
export const findDeliveryAddressById = params => {
return POST('GET', `${base}/deliveryAddress/findDeliveryAddressById`, params).then(res => res.data);
}
// 根据id 删除收货地址
export const deleteAddress = params => {
return POST('GET', `${base}/deliveryAddress/deleteShoppingCart`, params).then(res => res.data);
}
// 查询物流信息
export const getLogisticsMsg = params => {
return POST('GET', `${base}/goods/getLogisticsMsg`, params).then(res => res.data);
}
// 根据区域查询运费和包邮价格
export const getRegionFreight = params => {
return POST('GET', `${base}/common/getRegionFreight`, params).then(res => res.data);
}

@ -1,10 +1,10 @@
<template>
<view
class="data-list-components safe-area-inset-bottom"
:class="{ 'safe-area-inset-bottom': safeAreaInsetBottom }"
:style="[dataListStyle]"
class="data-list-components "
@touchmove.stop.prevent
>
<!-- :class="{ 'safe-area-inset-bottom': safeAreaInsetBottom }" -->
<!-- :style="[dataListStyle]" -->
<scroll-view
class="scroll-view"
:scroll-top="scrollTop"
@ -22,8 +22,6 @@
<view class="pull-down-view">
<slot name="refresh" v-if="$slots.refresh"></slot>
<view class="refresh-view" v-else>
<!-- <view class="loading-animation"></view> -->
<!-- <text class="pull-down-text">{{ refreshText[refreshStatus] }}</text> -->
<text :class="' pull-down-text icon-ymt '+(refreshStatus == 'soon'?' to-blod-down ':refreshStatus == 'sure'?' to-blod-up ':' ') " >{{ refreshText[refreshStatus] }}</text>
</view>
</view>
@ -36,17 +34,13 @@
</view>
<!-- -->
<view class="empty-view" v-if="showEmpty">
<slot name="empty" v-if="$slots.empty"></slot>
<view class="empty-content" v-else>
<image class="empty-image" :src="emptyImage || defaultEmptyImage" mode=""></image>
<view class=" empty-content" v-if="showEmpty">
<!-- <image class="empty-image" :src="emptyImage || defaultEmptyImage" mode=""></image> -->
<text class="empty-text">{{ emptyText }}</text>
</view>
</view>
<!-- 底部上滑 -->
<view class="pull-up-view" v-else>
<view class="pull-up-view" >
<slot name="load" v-if="$slots.load"></slot>
<view class="load-view" v-else>
<view class="loading-animation" v-if="loadStatus == 'loading'"></view>
@ -116,6 +110,10 @@ export default {
type: Boolean,
default: false
},
showEmpty:{
type: Boolean,
default: false
},
refresherThreshold: {
type: [Number, String],
default: 50
@ -138,13 +136,13 @@ export default {
total: -1, //
currentPage: 1, //
currentSize: 10, //
showEmpty: false, //
// showEmpty: false, //
waiting: false, //
loadingMask: this.loading, //
autoLoad: false, //
loadingMask: false, //
scrollTop: 0, //
currentScrollTop: 0, //
scrollingEnabled: true, //
pullingDown: false, //
pullDownHeight: 0, //
pullDownTimeStamp: 0, //
@ -156,7 +154,7 @@ export default {
maxDistance:100,
touchDirection:'top',
loadStatus: 'loading',
loadStatus: 'soon',
loadText: {
loading: '加载中~',
nomore: '没有更多啦~',
@ -197,19 +195,22 @@ export default {
},
computed: {
dataListStyle() {
const { componentsHeight } = this;
return {
height: componentsHeight
};
},
// dataListStyle() {
// const { componentsHeight } = this;
// return {
// height: componentsHeight
// };
// },
scrollContentStyle() {
const style = {};
const { pullDownHeight, pullingDown,pullUpHeight, pullingUp } = this;
// if(this.touchDirection == 'top'){
style.transform = pullingDown ? `translateY(${pullDownHeight}px)` : `translateY(0px)`;
style.transition = pullingDown ? `transform .1s linear` : `transform 0.3s cubic-bezier(0.19,1.64,0.42,0.72)`;
// }else if(this.touchDirection == 'bottom'){
// style.transform = pullingUp ? `translateY(0px)` : `translateY(0px)`;
@ -228,48 +229,39 @@ export default {
loadData() {
this.waiting = true;
this.$emit('load', { page: this.currentPage, size: this.currentSize }, res => {
this.$emit('load',res => {
this.waiting = false;
// this.loadingMask = false;
this.list = res.list;
this.total = res.total;
this.currentPage++;
this.handleComputeData();
this.computedHeight();
// this.computedHeight();
});
},
//
computedHeight() {
this.getRect('.data-list-components').then(res => {
// #ifdef H5
this.componentsHeight = `calc(100vh - ${res.top}px - var(--window-top))`;
// #endif
// #ifndef H5
this.componentsHeight = `calc(100vh - ${res.top}px)`;
// #endif
});
// this.getRect('.data-list-components').then(res => {
// console.log(res,"res")
// // #ifdef H5
// this.componentsHeight = `calc(100vh - ${res.top}px - var(--window-top))`;
// // #endif
// // #ifndef H5
// this.componentsHeight = `calc(100vh - ${res.top}px)`;
// // #endif
// });
},
//
handleComputeData() {
const len = this.list.length;
const total = this.total;
if (len == 0 || total == 0) {
this.autoLoad = false;
this.showEmpty = true;
} else if (len >= this.total) {
this.autoLoad = false;
this.showEmpty = false;
console.log(len,total)
if (len >= this.total) {
this.loadStatus = 'soon';
} else if (len < this.total) {
this.showEmpty = false;
this.loadStatus = 'loading';
// console.log(len,this.total,this.loadStatus)
}
},
//
handleScrolltolower(e) {
@ -279,23 +271,30 @@ export default {
},
//
handleScroll(e) {
this.currentScrollTop = e.detail.scrollTop;
// this.currentScrollTop = e.detail.scrollTop;
if (e.detail.scrollTop <= 20) {
this.touchDirection = 'top';
} else {
this.touchDirection = 'bottom';
}
// if (e.detail.scrollTop <= 20) {
// this.touchDirection = 'top';
// } else {
// this.touchDirection = 'bottom';
// }
// console.log(e.detail.scrollTop)
this.$emit('scroll', e);
},
//
handleTouchStart(e) {
if(this.touchDirection=='top'){
// if (e.detail.scrollTop <= 20) {
// }
// console.log(e)
// if(this.touchDirection=='top'){
this.pullingDown = true;
}else if(this.touchDirection=='bottom'){
this.pullingUp =true;
}
// }else if(this.touchDirection=='bottom'){
// this.pullingUp =true;
// }
this.currentTouchStartY = e.touches[0].clientY;
},
@ -304,12 +303,9 @@ export default {
// this.$emit('refresherpulling', e);
//
console.log(e.touches[0].clientY >= this.currentTouchStartY)
if (e.touches[0].clientY >= this.currentTouchStartY){
// const shakeInterval = 1000 / 60;
// const currentTimeStamp = new Date().getTime();
// if (this.pullDownTimeStamp && currentTimeStamp - this.pullDownTimeStamp <= shakeInterval) return;
// this.pullDownTimeStamp = currentTimeStamp;
this.touchDirection=='top'
const currentTouchMoveY = e.touches[0].clientY;
let movingDistance = (currentTouchMoveY - this.currentTouchStartY) ;
if(this.selectObject.selectIndex == 0){
@ -318,25 +314,20 @@ export default {
else if(movingDistance > this.refresherThreshold){
this.refreshStatus = 'sure';//
}else{
// movingDistance = 0;
this.refreshStatus = 'soon';//
}
let computeDistance = movingDistance;
if(computeDistance > this.maxDistance){
computeDistance = this.maxDistance;
}
this.pullDownHeight = computeDistance ;
}else{
//
this.touchDirection=='bottom';
const currentTouchMoveY = e.touches[0].clientY;
let movingDistance = (this.currentTouchStartY - currentTouchMoveY ) ;
if(this.selectObject.selectIndex == this.selectObject.length-1){
this.loadStatus = 'nomore'
this.loadStatus = 'nomore';
}else if (movingDistance >= this.lowerThreshold) {
this.loadStatus = 'sure';//
@ -356,6 +347,7 @@ export default {
},
//
handleTouchEnd(e) {
console.log(this.touchDirection)
//
if(this.touchDirection == 'top'){
if(this.pullDownHeight>=this.refresherThreshold&&this.selectObject.selectIndex > 0){
@ -365,8 +357,10 @@ export default {
this.pullDownHeight = 0;
//
}else if(this.touchDirection == 'bottom'){
if(this.pullUpHeight>=this.lowerThreshold&&this.selectObject.selectIndex < (this.selectObject.length-1)){
this.$emit('refresherrefresh', "next");
}
this.pullingUp = false;
this.pullUpHeight = 0;
@ -376,7 +370,8 @@ export default {
handleInit() {
this.currentPage = this.page;
this.currentSize = this.size;
this.computedHeight();
// console.log()
// this.computedHeight();
},
// dom
getRect(selector, all) {
@ -414,21 +409,25 @@ export default {
display: flex;
align-items: center;
justify-content: center;
}
.empty-content {
margin: auto;
height:calc(100% - 20px) ;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
.empty-image {
width: 400rpx;
height: 400rpx;
width: 100%;
// height: 100%;
}
.empty-text {
display: block;
color: #606266;
margin-top: 20rpx;
}
}
}
.pull-down-view {
top: 0;
left: 0;
@ -478,17 +477,18 @@ export default {
}
.pull-up-view {
width: 100%;
padding: 15rpx 0;
// padding: 15rpx 0;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
.load-view {
display: flex;
align-items: center;
.loading-animation {
width: 30rpx;
height: 30rpx;
}
// .loading-animation {
// width: 30rpx;
// height: 30rpx;
// }
.loading-text {
color: #606266;
font-size: 24rpx;

@ -0,0 +1,162 @@
<template>
<picker mode="multiSelector"
:value="multiIndex"
:range="multiArray"
@change="handleValueChange"
@columnchange="handleColumnChange">
<slot></slot>
</picker>
</template>
<script>
// let CHINA_REGIONS = require('./regions.json')
import { getRegional } from '@/Utils/physicalObject.js'
// let CHINA_REGIONS = [{childs:[{childs:[]}]}];
// getRegional().then(res=>{
// CHINA_REGIONS = res.return_data;
// })
export default {
props:{
defaultRegions:{
type:Array,
default(){
return []
}
},
defaultRegionCode:{
type:String
},
defaultRegion:[String,Array]
},
data() {
return {
CHINA_REGIONS:[{childs:[{childs:[]}]}],
// cityArr:CHINA_REGIONS[0].childs,
// districtArr:CHINA_REGIONS[0].childs[0].childs,
cityArr:[{}],
districtArr:[{}],
multiIndex: [0, 0, 0],
isInitMultiArray:true,
}
},
created(){
getRegional().then(res=>{
this.CHINA_REGIONS = res.return_data;
this.CHINA_REGIONS.map(item=>{
if(!item.childs){
item.childs = [];
}
})
this.cityArr =this.CHINA_REGIONS[0].childs;
this.districtArr = this.CHINA_REGIONS[0].childs[0].childs;
// console.log(res.return_data,11)
})
},
watch:{
defaultRegion:{
handler(region,oldRegion){
if(Array.isArray(region)){
//
oldRegion = oldRegion || []
if(region.join('')!==oldRegion.join('')){
this.handleDefaultRegion(region)
}
}else if(region&&region.length == 6){
this.handleDefaultRegion(region)
}else{
console.warn('defaultRegion非有效格式')
}
},
immediate:true,
}
},
computed:{
multiArray(){
return this.pickedArr.map(arr=>arr.map(item=>item.name))
},
pickedArr(){
//
if(this.isInitMultiArray){
return [
this.CHINA_REGIONS,
this.CHINA_REGIONS[0].childs,
this.CHINA_REGIONS[0].childs[0].childs
]
}
return [this.CHINA_REGIONS,this.cityArr,this.districtArr];
}
},
methods: {
handleColumnChange(e){
// console.log(e);
this.isInitMultiArray = false;
const that = this;
let col = e.detail.column;
let row = e.detail.value;
that.multiIndex[col] = row;
try{
switch(col){
case 0:
if(this.CHINA_REGIONS[that.multiIndex[0]].childs.length==0){
that.cityArr = that.districtArr = [this.CHINA_REGIONS[that.multiIndex[0]]]
break;
}
that.cityArr = this.CHINA_REGIONS[that.multiIndex[0]].childs
that.districtArr = this.CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 1:
that.districtArr = this.CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
break;
case 2:
break;
}
}catch(e){
// console.log(e);
that.districtArr = this.CHINA_REGIONS[that.multiIndex[0]].childs[0].childs
}
},
handleValueChange(e){
//
let [index0,index1,index2] = e.detail.value;
let [arr0,arr1,arr2] = this.pickedArr;
let address = [arr0[index0],arr1[index1],arr2[index2]];
// console.log(address);
this.$emit('getRegion',address)
},
handleDefaultRegion(region){
const isCode = !Array.isArray(region)
this.isInitMultiArray = false;
let children = this.CHINA_REGIONS
for(let i=0;i<3;i++){
for(let j=0;j<children.length;j++){
let condition = isCode?children[j].code==region.slice(0,(i+1)*2):children[j].name.includes(region[i]);
if(condition){
//
// console.log(i,j,children.length-1);
children = children[j].childs;
if(i==0){
this.cityArr = children
}else if(i==1){
this.districtArr = children
}
this.$set(this.multiIndex,i,j)
// console.log(this.multiIndex);
break;
}else{
//
// console.log(i,j,children.length-1);
if(i==0 && j==(children.length-1)){
this.isInitMultiArray = true;
}
}
}
}
}
},
}
</script>

@ -175,24 +175,24 @@
},
//
callPhone(){
uni.showModal({
title: '客服',
content: '85655525652',
success: function(res) {
if (res.confirm) {
uni.makePhoneCall({
phoneNumber: '85655525652', //
success: function(e) {
console.log(e);
},
fail: function(e) {
console.log(e);
// uni.showModal({
// title: '',
// content: '85655525652',
// success: function(res) {
// if (res.confirm) {
// uni.makePhoneCall({
// phoneNumber: '85655525652', //
// success: function(e) {
// console.log(e);
// },
// fail: function(e) {
// console.log(e);
}
})
}
}
})
// }
// })
// }
// }
// })
},

@ -70,7 +70,7 @@
"desc" : "你的位置信息将用于小程序定位"
}
},
"requiredPrivateInfos" : [ "getLocation" ]
"requiredPrivateInfos" : [ "getLocation","chooseAddress" ]
},
"h5" : {
"sdkConfigs" : {
@ -89,7 +89,12 @@
"port" : "",
"https" : true
},
"domain" : "https://hsgcs.dctpay.com",
"domain" : "",
"optimization" : {
"treeShaking" : {
"enable" : true
}
},
"template" : "index.html"
}
}

@ -117,13 +117,13 @@
// "enablePullDownRefresh": false
// }
// },
{
"path": "pages/classify/order/pay",
"style": {
"navigationBarTitleText": "收银台页",
"enablePullDownRefresh": false
}
},
// {
// "path": "pages/classify/order/pay",
// "style": {
// "navigationBarTitleText": "收银台页",
// "enablePullDownRefresh": false
// }
// },
{
"path": "pages/classify/order/paymentResult",
"style": {
@ -936,14 +936,20 @@
"path": "shareCounpon/shareCounpon",
"style": {
"navigationBarTitleText": "分享领取优惠券",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false //
}
}
}, {
"path": "shareImgage/shareImgage",
"style": {
"navigationBarTitleText": "分享领取优惠券",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": false //
}
}
}
@ -1113,7 +1119,7 @@
]
},
"condition" : { //
"current": 0, //(list )
// "current": 0, //(list )
// "list": [
// {
// "name": "", //
@ -1121,45 +1127,5 @@
// "query": "" //onLoad
// }
// ]
"list": [
// {
// "name": "物流信息", //
// "path": "pages/wuliu/wuliu", //
// "query": "id=1" //onLoad
// },
{
"name": "收银台页", //
"path": "pages/classify/order/pay", //
"query": "id=1" //onLoad
},
{
"name": "我的地址", //
"path": "pages/address/address", //
"query": "id=1" //onLoad
},
{
"name": "订单列表", //
"path": "pages/classify/order/order", //
"query": "id=1" //onLoad
},
{
"name": "订单详情", //
"path": "pages/classify/order/orderDetail", //
"query": "id=1" //onLoad
},
{
"name": "订单确认", //
"path": "pages/settleAccounts/settleAccounts", //
"query": "id=1" //onLoad
},
{
"name": "修改订单", //
"path": "pages/classify/order/editOrder" //
}
]
}
}

@ -1,350 +1,448 @@
<template>
<view class="container">
<view class='addAddress'>
<!-- <view class="pad30">
<view class='default acea-row row-middle borderRadius15'>
<input v-model="addressValue" type="text" placeholder="粘贴地址信息,自动拆分姓名、电话和地址"
placeholder-class='placeholder' style="width:100%;"
@blur="identify()">
<view class="page-bottom-fixed backcor9">
<form @submit="form_submit" class="form-container">
<view class="pd-main height100">
<view class="form-gorup backcolorfff">
<view class="form-gorup-item-left">
<view class="form-gorup-title marb10">联系人<text class="form-group-tips-must">*</text></view>
<input type="text" name="name" v-model="userAddress.name" maxlength="5"
placeholder-class="fcor666" class="fcor666 " placeholder="联系人2~5个字符">
</view>
</view> -->
<view class="pad30 mt-22">
<view class='list borderRadius15'>
<uni-forms ref="form" label-position="left" :modelValue="userAddress">
<uni-forms-item label="姓名" name="real_name" class='item acea-row row-between-wrapper'>
<view class="form-gorup-item-right">
<view class="form-gorup-title marb10">联系电话<text class="form-group-tips-must">*</text></view>
<input type="text" name="tel" v-model="userAddress.tel" maxlength="11"
placeholder-class="fcor666" class="fcor666" placeholder="手机号">
</view>
</view>
<view class="form-gorup backcolorfff">
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name"
placeholder-class='placeholder' class="width100"></input>
</uni-forms-item>
<!-- <view> -->
<!-- <view class="form-gorup-title">省市区<text class="form-group-tips-must">必选</text></view> -->
<!-- <view class="dis-flex flex-sp" @click="chooseAddress">
<input type='text' placeholder='请选择地址' :disabled="true" name='region'
:value='userAddress.region' class="fcor666 flex-1">
<view class="icon-ymt to-right font14 fcor666">
<uni-forms-item label="联系电话" name="phone" class='item acea-row row-between-wrapper'>
</view>
<input type='number' placeholder='请输入联系电话' name="phone" v-model='userAddress.phone'
placeholder-class='placeholder' pattern="\d*"></input>
</uni-forms-item>
<uni-forms-item label="所在地区" name="region" class='item acea-row row-between-wrapper'>
<view class="address acea-row row-between height100" @click="chooseAddress">
<input type='text' placeholder='请选择地址' :disabled="true" name='region' placeholder-class='placeholder'
v-model='userAddress.region' class="detail"></input>
</view> -->
<!-- -->
<view class="">
<pick-regions :defaultRegion="defaultRegionCode" @getRegion="handleGetRegion">
<view class="dis-flex flex-sp form-gorup-title">
<view class=" flex-1">点击选择省市区<text class="form-group-tips-must">必选</text></view>
<!-- <input type='text' placeholder='请选择地址' :disabled="false" name='region'
v-model='userAddress.region' class=" flex-1 fcor333" placeholder-class="fcor333" style="font-size: 16px;">
-->
<view class="icon-ymt to-right font14 fcor666">
</view>
</view>
</uni-forms-item>
</pick-regions>
<view class="font15 fcor666" style="height: 20px;line-height: 20px;">{{userAddress.region || '请选择'}}</view>
</view>
<!-- </view> -->
<uni-forms-item label="详细地址" name="detail" class='item acea-row row-between-wrapper'>
<view style="clear: both;">
<view class="form-gorup-title">详细地址<text class="form-group-tips-must">*</text>
</view>
<input type="text" name="address" v-model="userAddress.address" maxlength="40"
placeholder-class="fcor666" :class="'fcor666 bs-bb '" placeholder="详细地址1~40个字符">
</view>
<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder'
v-model='userAddress.detail' class="detail"></input>
</view>
</uni-forms-item>
</uni-forms>
<view class="default-checkbox " @click="defaultChange">
<radio :checked="userAddress.is_default" style="transform:scale(0.7)" color="#FF1A34" />
<text class="">设为默认地址</text>
</view>
<view class="bottom-fixed padding-main">
<button class=" " type="default" form-type="submit">保存</button>
</view>
<button class='keepBnt bg-color' @click="formSubmit">立即保存</button>
</view>
<AddressPicker ref="AddressPicker" @getAddress="getAddress"></AddressPicker>
</form>
</view>
</template>
<script>
import uniForms from '@/components/uni-forms/components/uni-forms/uni-forms.vue'
import uniFormsItem from '@/components/uni-forms/components/uni-forms-item/uni-forms-item.vue'
import AddressPicker from '@/pages/address/addNewAddress/addressPicker.vue'
let dataList = require('./address.json')
import pickRegions from '@/components/pick-regions/pick-regions.vue'
import {insertDeliveryAddress,findDeliveryAddressById,updateDeliveryAddress } from '@/Utils/physicalObject.js'
export default {
data() {
return {
userAddress: {
real_name:"",
phone:"",
region:"",
detail:"",
}, //
addressValue:"",
addressId:null,
/* rulesObject:{
real_name:{
rules:[
// name
{
required: true,
errorMessage: '请填写姓名',
},
// name
{
minLength: 2,
maxLength: 5,
errorMessage: '{label}长度在 {minLength} 到 {maxLength} 个字符',
}
],
},
phone:{
rules:[
{
required: true,
errorMessage: '请输入手机号',
name: "",
tel: "",
region: '',
address: "",
is_default: false,
},
{
validateFunction: function(rule, value, data, callback) {
let iphoneReg = /^1[0-9]{10}$/
if (!iphoneReg.test(value)) {
callback('手机号码格式不正确,请重新填写')
}
return true
}
}
dataParams: null,
//
region: [],
regionId:'',
//
defaultRegion: ['北京市', '市辖区', '东城区'],
defaultRegionCode: '120101',
],
},
region:{
rules:[
{
required: true,
errorMessage: '请选择地址',
},
],
},
detail:{
rules:[
{
required: true,
errorMessage: '请填写详细地址',
};
},
{
minLength: 5,
errorMessage: '{label}长度不能少于{minLength}个字符',
}
components: {
pickRegions
],
},
}
*/
}
},
components:{
AddressPicker,
"uni-forms":uniForms,
"uni-forms-item":uniFormsItem
// uniForms,
// uniFormsItem
onLoad(params) {
this.dataParams = params
},
onReady() {
// onReady
// this.$refs.form.setRules(this.rulesObject)
computed: {
// if(this.addressId){
// uni.setNavigationBarTitle({
// title: ''
// });
// regionName() {
// //
// // console.log('==============='+this.region.map(item => item))
// // this.userAddress.region = this.region.map(item => item.name).join(',')
// return this.region.map(item => item.name).join(',')
// }
},
onLoad(options){
if(options.id){
this.addressId = options.id
onReady() {
uni.setNavigationBarTitle({
title: '编辑地址'
title: '地址'+(((this.dataParams.id || null) == null) ? '添加' : '编辑')
});
if(this.dataParams.id){
this.findAddressById(this.dataParams.id)
}
},
},
methods: {
identify(){
const options = {
type: 0, // 01
textFilter: [], //
nameMaxLength: 4, //
findAddressById(id){
let params = {
id:id
}
findDeliveryAddressById(params).then(res=>{
if (res.return_code == '000000') {
let resData = res.return_data;
this.userAddress = {
name: resData.consignee,
tel: resData.phone,
region: resData.regionName,
address: resData.address,
is_default: resData.whetherDefault,
}
console.log(this.defaultRegionCode)
this.defaultRegionCode = resData.regionId
console.log(this.defaultRegionCode)
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
// type0使1, textFilter
// if(!!this.addressValue){
// const parseResult = AddressParse(this.addressValue, options)
// // console.log(parseResult);
// this.userAddress.real_name = parseResult.name;
// this.userAddress.phone = parseResult.phone;
// this.userAddress.detail = parseResult.detail;
// this.userAddress.region = parseResult.province + '/' + parseResult.city + '/' + parseResult.area;
// }
})
},
formSubmit(form) {
//
handleGetRegion(region) {
this.region = region;
this.userAddress.region = this.region.map(item => item.name).join(',');
this.regionId = this.region[2].code;
console.log(this.userAddress.region,"获取选择的地区")
},
//
init() {
//
},
// this.$refs.form.validate().then(res => {
// console.log('success', res);
// uni.showToast({
// title: ``
// })
// }).catch(err => {
// console.log('err', err);
// })
let _this = this;
this.$refs.form.validate().then(res=>{
console.log(_this.userAddress,res)
})
//
defaultChange(e) {
this.userAddress.is_default = !this.userAddress.is_default
},
chooseAddress(){
this.$refs.AddressPicker.show()
},
getAddress(address){
console.log(address,"address")
this.userAddress.region=address
}
},
}
</script>
<style lang="scss" scoped>
.container{
background-color: #f5f5f5;
height: 100vh;
box-sizing: border-box;
padding-top:30rpx;
}
/deep/ .uni-forms-item__label .label-text{
font-size: 30rpx !important;
}
/deep/ .uni-forms-item{
width: 100% !important;
}
.pad30 {
padding: 0 30rpx
//
form_submit() {
//
var validation = [{
fields: "name",
msg: "请填写联系人"
},
{
fields: "tel",
msg: "请填写联系电话",
vali:/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
},
{
fields: "region",
msg: "请选择省市区"
},
{
fields: "address",
msg: "请填写详细地址"
}
];
this.fields_check(this.userAddress, validation)
let isVali = this.fields_check(this.userAddress, validation);
if(isVali){
.acea-row {
display: flex;
align-items: center;
}
.row-middle {
align-items: center
}
.row-between-wrapper {
align-items: center;
justify-content: space-between
}
.borderRadius15 {
border-radius: 15rpx !important;
if(this.dataParams.id){
this.updateAddress(this.dataParams.id)
}else{
this.addAddress()
}
.addAddress .list {
background-color: #fff;
}
.addAddress .list .item {
padding: 30rpx ;
padding-bottom: 0;
border-top: 1rpx solid #eee;
position: relative;
}
.addAddress .list .item .detail{
// width: 368rpx;
},
updateAddress(id){
let _this = this;
let params ={
"id": id,
"address": _this.userAddress.address,
"consignee": _this.userAddress.name,
"phone": _this.userAddress.tel,
"regionId": _this.regionId,
"regionName":_this.userAddress.region,
"whetherDefault": _this.userAddress.is_default
}
updateDeliveryAddress(params).then(res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
//
this.backPageRefresh();
})
},
backPageRefresh() {
let pages = getCurrentPages(); //
let beforePage = pages[pages.length - 2]; //
uni.navigateBack({
success:function(){
beforePage.$vm.initData();
// console.log("!");
}
})
},
addAddress(){
let _this = this;
let params={
"address": _this.userAddress.address,
"consignee": _this.userAddress.name,
"phone": _this.userAddress.tel,
"regionId": _this.regionId,
"regionName":_this.userAddress.region,
"whetherDefault": _this.userAddress.is_default
}
// console.log(params,this.userAddress)
insertDeliveryAddress(params).then(res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
.addAddress .list .item .location{
position: absolute;
right: 46rpx;
top: 50%;
margin-top: -40rpx!important;
font-size: 24rpx;
text-align: center;
}
//
_this.backPageRefresh()
})
},
.addAddress .list .item .name {
width: 195rpx;
font-size: 30rpx;
color: #333;
/**
* 字段数据校验
* data 待校验的数据, 一维json对象
* validation 待校验的字段, 格式 [{fields: 'mobile', msg: '请填写手机号码', is_can_zero: 1(是否可以为0)}, ...]
*/
fields_check(data, validation) {
for (var i in validation) {
var temp_value = data[validation[i]["fields"]];
if (!temp_value) {
uni.showToast({
title: validation[i]['msg'],
duration: 1000,
icon: 'none'
});
return false;
}
.addAddress .list .item .address {
flex: 1;
if(validation[i]["vali"]){
console.log(validation[i]["vali"].test(this.userAddress.tel),this.userAddress.tel)
if(!(validation[i]["vali"].test(this.userAddress.tel))){
uni.showToast({
title: "请输入正确格式的手机号码",
duration: 1000,
icon: 'none'
});
return false;
}
.addAddress .list .item .address .addressCon{
width: 360rpx;
}
.addAddress .list .item .address .addressCon .tip{
font-size: 21rpx;
margin-top: 4rpx;
}
.addAddress .list .item input {
// width: 475rpx;
flex: 1;
font-size: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
return true;
},
}
};
</script>
<style lang="scss" scoped>
.padding-main {
padding: 20rpx;
}
.placeholder {
color: #ccc;
.bottom-fixed {
position: fixed;
left: 0;
bottom: 0;
border: none;
width: 100%;
box-sizing: border-box;
z-index: 2;
}
.addAddress .list .item .picker {
width: 430rpx;
font-size: 30rpx;
.page-bottom-fixed {
height: 100vh;
padding-bottom: 120rpx;
box-sizing: border-box;
}
/*表单*/
.form-container {
height: 100%;
.form-gorup {
padding: 20rpx;
margin-bottom: 20rpx;
border-radius: 20rpx;
overflow: auto;
.addAddress .default {
padding: 0 30rpx;
height: 90rpx;
background-color: #fff;
input {
border-radius: 0;
box-sizing: border-box;
font-size: 28rpx;
height: 70rpx;
line-height: 70rpx;
}
.addAddress .keepBnt {
width: 690rpx;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 50rpx auto;
font-size: 32rpx;
color: #fff;
}
.form-gorup-title {
padding: 20rpx 0;
margin-bottom: 5rpx;
font-weight: 500;
font-size: 16px;
}
}
.mt-22{
margin-top: 22rpx;
.form-gorup-item-left {
float: left;
padding-right: 20rpx;
}
.bg-color {
background-color: #dd524d;
.form-group-tips-must {
margin-left: 20rpx;
font-size: 24rpx;
color: #f00;
}
/*
* 三级联动
*/
// .select-address {
// box-sizing: border-box;
// height: 70rpx;
// line-height: 70rpx;
// padding: 0 10rpx;
// height: auto;
// overflow: auto;
// .fl{
// float: left;
// }
// }
// .select-address .section {
// width: 33.33%;
// box-sizing: border-box;
// }
// .select-address .section:not(:first-child) {
// padding: 0 5rpx;
// }
/**
* 地址信息
*/
// .default-checkbox image {
// width: 35rpx;
// height: 35rpx !important;
// }
// .address-value {
// padding-right: 110rpx;
// }
// .map-icon {
// bottom: 0;
// right: 0;
// width: 90rpx;
// height: 80rpx;
// line-height: 80rpx;
// }
// .auto-discern {
// bottom: 20rpx;
// right: 20rpx;
// z-index: 2;
// }
// .auto-discern button {
// line-height: inherit;
// padding: 5rpx 20rpx !important;
// }
/*
* 身份信息
*/
// .idcard-container {
// background: #e6e6e6;
// }
// .idcard-container .form-upload-data .item image {
// width: 256rpx;
// height: 170rpx;
// border: 1px dashed #c2c2c2;
// }
</style>

File diff suppressed because it is too large Load Diff

@ -1,171 +0,0 @@
<template>
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="0" :showCloseIcon="false">
<view class="popup">
<view class="top-title dis-flex flex-sp pd-main border-b">
<view class="left" @click="close">取消</view>
<view class="right" @click="confirm">确定</view>
</view>
<picker-view :indicator-style="bootStyle" :value="selectList" @change="selectData">
<picker-view-column>
<view class="item" v-for="(item,index) in province" :key="item.id">{{item.name}}</view>
</picker-view-column>
<!-- v-if="province[selectList[0]]" -->
<picker-view-column >
<view class="item" v-for="(item,index) in citylist" :key="index">{{item.name}}</view>
</picker-view-column>
<!-- v-if="citylist[selectList[0]]" -->
<picker-view-column >
<view class="item" v-for="(item,index) in arealist" :key="index">{{item.name}}</view>
</picker-view-column>
</picker-view>
</view>
</wybPopup>
</template>
<script>
import wybPopup from '@/components/wyb-popup/wyb-popup.vue'
let AllAddress = require('./address.json')
export default {
data() {
return{
addInfo:"请选择省市区", //广 广
bootStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth/(750/100))}px;`,
selectList: [0, 0, 0], //
oldSelectList:[],
province: [], //
citylist:[], //
arealist:[], //
}
},
components:{
wybPopup
},
methods:{
show(){
this.province=JSON.parse(JSON.stringify(AllAddress)) ;
this.initData();
this.$refs.popup.show()
},
//
confirm() {
var sheng = ""; //
var city = ""; //
var area = ""; //
if(this.province){
sheng = this.province[this.selectList[0]].name;
}
if(this.citylist){
city = this.citylist[this.selectList[1]].name;
}
if(this.arealist){
area = this.arealist[this.selectList[2]].name;
}
var value = sheng;
if(city){
value += " " + city;
}
if(area){
value += " " + area;
}
this.addInfo = value;
this.$emit("getAddress",this.addInfo)
this.$refs.popup.close()
},
//
close() {
this.$refs.popup.close()
},
// picker-viewchange
selectData(e) {
const val = e.detail.value;
this.oldSelectList=this.selectList;
this.selectList=val;
let that = this;
let arr=[];
// console.log(this.selectList,1)
this.selectList.map((item,index1)=>{
that.oldSelectList.map((item2,index2)=>{
if(index1 == index2 && item != item2 ){
if(index1!=2){
if(index1 == 0){
arr = [item,0,0];
}
if(index1 == 1){
arr = [that.selectList[index1-1],item,0];
}
that.selectList=arr;
}
return
}
})
})
// console.log(that.selectList,2)
this.initData()
},
initData(){
// console.log(this.selectList[0],this.selectList[1],"aa",this.selectList)
this.citylist = this.province[this.selectList[0]].children; //
this.arealist = this.province[this.selectList[0]].children[this.selectList[1]].children; //
}
}
}
</script>
<style lang="scss">
// .top-title{
// height: 40px;
// line-height: 40px;
// }
// .picker-v{
// height:calc(100% - 40px);
// box-sizing: border-box;
// }
uni-picker-view {
display: block;
}
uni-picker-view .uni-picker-view-wrapper {
display: flex;
position: relative;
overflow: hidden;
height: 100%;
background-color: white;
}
uni-picker-view[hidden] {
display: none;
}
picker-view {
width: 100%;
// height: 600upx;
height: 400rpx;
margin-top: 20upx;
}
.item {
line-height: 100upx;
text-align: center;
}
</style>

@ -0,0 +1,350 @@
<template>
<view class="container">
<view class='addAddress'>
<!-- <view class="pad30">
<view class='default acea-row row-middle borderRadius15'>
<input v-model="addressValue" type="text" placeholder="粘贴地址信息,自动拆分姓名、电话和地址"
placeholder-class='placeholder' style="width:100%;"
@blur="identify()">
</view>
</view> -->
<view class="pad30 mt-22">
<view class='list borderRadius15'>
<uni-forms ref="form" label-position="left" :modelValue="userAddress">
<uni-forms-item label="姓名" name="real_name" class='item acea-row row-between-wrapper'>
<input type='text' placeholder='请输入姓名' name='real_name' :value="userAddress.real_name"
placeholder-class='placeholder' class="width100"></input>
</uni-forms-item>
<uni-forms-item label="联系电话" name="phone" class='item acea-row row-between-wrapper'>
<input type='number' placeholder='请输入联系电话' name="phone" v-model='userAddress.phone'
placeholder-class='placeholder' pattern="\d*"></input>
</uni-forms-item>
<uni-forms-item label="所在地区" name="region" class='item acea-row row-between-wrapper'>
<view class="address acea-row row-between height100" @click="chooseAddress">
<input type='text' placeholder='请选择地址' :disabled="true" name='region' placeholder-class='placeholder'
v-model='userAddress.region' class="detail"></input>
<view class="icon-ymt to-right font14 fcor666">
</view>
</view>
</uni-forms-item>
<uni-forms-item label="详细地址" name="detail" class='item acea-row row-between-wrapper'>
<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder'
v-model='userAddress.detail' class="detail"></input>
</uni-forms-item>
</uni-forms>
</view>
</view>
<button class='keepBnt bg-color' @click="formSubmit">立即保存</button>
</view>
<AddressPicker ref="AddressPicker" @getAddress="getAddress"></AddressPicker>
</view>
</template>
<script>
import uniForms from '@/components/uni-forms/components/uni-forms/uni-forms.vue'
import uniFormsItem from '@/components/uni-forms/components/uni-forms-item/uni-forms-item.vue'
import AddressPicker from '@/pages/address/addNewAddress/addressPicker.vue'
let dataList = require('./address.json')
export default {
data() {
return {
userAddress: {
real_name:"",
phone:"",
region:"",
detail:"",
}, //
addressValue:"",
addressId:null,
/* rulesObject:{
real_name:{
rules:[
// name
{
required: true,
errorMessage: '请填写姓名',
},
// name
{
minLength: 2,
maxLength: 5,
errorMessage: '{label}长度在 {minLength} 到 {maxLength} 个字符',
}
],
},
phone:{
rules:[
{
required: true,
errorMessage: '请输入手机号',
},
{
validateFunction: function(rule, value, data, callback) {
let iphoneReg = /^1[0-9]{10}$/
if (!iphoneReg.test(value)) {
callback('手机号码格式不正确,请重新填写')
}
return true
}
}
],
},
region:{
rules:[
{
required: true,
errorMessage: '请选择地址',
},
],
},
detail:{
rules:[
{
required: true,
errorMessage: '请填写详细地址',
},
{
minLength: 5,
errorMessage: '{label}长度不能少于{minLength}个字符',
}
],
},
}
*/
}
},
components:{
AddressPicker,
"uni-forms":uniForms,
"uni-forms-item":uniFormsItem
// uniForms,
// uniFormsItem
},
onReady() {
// onReady
// this.$refs.form.setRules(this.rulesObject)
// if(this.addressId){
// uni.setNavigationBarTitle({
// title: ''
// });
// }
},
onLoad(options){
if(options.id){
this.addressId = options.id
uni.setNavigationBarTitle({
title: '编辑地址'
});
}
},
methods: {
identify(){
const options = {
type: 0, // 01
textFilter: [], //
nameMaxLength: 4, //
}
// type0使1, textFilter
// if(!!this.addressValue){
// const parseResult = AddressParse(this.addressValue, options)
// // console.log(parseResult);
// this.userAddress.real_name = parseResult.name;
// this.userAddress.phone = parseResult.phone;
// this.userAddress.detail = parseResult.detail;
// this.userAddress.region = parseResult.province + '/' + parseResult.city + '/' + parseResult.area;
// }
},
formSubmit(form) {
//
// this.$refs.form.validate().then(res => {
// console.log('success', res);
// uni.showToast({
// title: ``
// })
// }).catch(err => {
// console.log('err', err);
// })
let _this = this;
this.$refs.form.validate().then(res=>{
console.log(_this.userAddress,res)
})
},
chooseAddress(){
this.$refs.AddressPicker.show()
},
getAddress(address){
console.log(address,"address")
this.userAddress.region=address
}
},
}
</script>
<style lang="scss" scoped>
.container{
background-color: #f5f5f5;
height: 100vh;
box-sizing: border-box;
padding-top:30rpx;
}
/deep/ .uni-forms-item__label .label-text{
font-size: 30rpx !important;
}
/deep/ .uni-forms-item{
width: 100% !important;
}
.pad30 {
padding: 0 30rpx
}
.acea-row {
display: flex;
align-items: center;
}
.row-middle {
align-items: center
}
.row-between-wrapper {
align-items: center;
justify-content: space-between
}
.borderRadius15 {
border-radius: 15rpx !important;
}
.addAddress .list {
background-color: #fff;
}
.addAddress .list .item {
padding: 30rpx ;
padding-bottom: 0;
border-top: 1rpx solid #eee;
position: relative;
}
.addAddress .list .item .detail{
// width: 368rpx;
}
.addAddress .list .item .location{
position: absolute;
right: 46rpx;
top: 50%;
margin-top: -40rpx!important;
font-size: 24rpx;
text-align: center;
}
.addAddress .list .item .name {
width: 195rpx;
font-size: 30rpx;
color: #333;
}
.addAddress .list .item .address {
flex: 1;
}
.addAddress .list .item .address .addressCon{
width: 360rpx;
}
.addAddress .list .item .address .addressCon .tip{
font-size: 21rpx;
margin-top: 4rpx;
}
.addAddress .list .item input {
// width: 475rpx;
flex: 1;
font-size: 30rpx;
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
}
.placeholder {
color: #ccc;
}
.addAddress .list .item .picker {
width: 430rpx;
font-size: 30rpx;
}
.addAddress .default {
padding: 0 30rpx;
height: 90rpx;
background-color: #fff;
}
.addAddress .keepBnt {
width: 690rpx;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 50rpx auto;
font-size: 32rpx;
color: #fff;
}
.mt-22{
margin-top: 22rpx;
}
.bg-color {
background-color: #dd524d;
}
</style>

@ -4,26 +4,26 @@
<scroll-view scroll-y="true" class="address-contain paading10" >
<radio-group @change="radioChange">
<view v-for="(item,index) in addressId" :key="index" class="border-8r paading10 backcolorfff marb10">
<view v-for="(item,index) in addressList" :key="item.id" class="border-8r paading10 backcolorfff marb10">
<view class="user-msg border-b paddbotm5">
<view class=" mart3 " >
<text class="address-name">明明</text>
<text class=" margle10 ">13563256324</text>
<text class="address-name">{{item.consignee}}</text>
<text class=" margle10 ">{{item.phone}}</text>
</view>
<view class="color999 mart5" >
地址:重庆市渝中区不是的聚钓具偶家
地址:{{item.regionName +" " +item.address}}
</view>
</view>
<view class="user-handle mart10">
<view class="handle-left">
<radio :checked="selectId == item" style="transform:scale(0.7)" :value="item" color="#FF1A34" />
<!-- <radio :checked="item.whetherDefault" style="transform:scale(0.7)" :value="item.id" color="#FF1A34" /> -->
<radio :checked="selectId == item.id" style="transform:scale(0.7)" :value="item.id" color="#FF1A34" />
<text class=" margle">默认地址</text>
</view>
<view class="handle-right">
<button type="primary" class="marRight10" plain="true" size="mini" @click="editAddress">编辑</button>
<button type="warn" plain="true" size="mini" @click="deleteAddress">删除</button>
<button type="primary" class="marRight10" plain="true" size="mini" @click="editAddress(item.id)">编辑</button>
<button type="warn" plain="true" size="mini" @click="deleteAddress(item.id)">删除</button>
</view>
</view>
@ -42,7 +42,7 @@
<script>
import noMore from '@/pages/classify/no-more/no-more.vue'
import { getDeliveryAddressList,deleteAddress,updateDeliveryAddress } from '@/Utils/physicalObject.js'
export default {
@ -55,19 +55,115 @@
addressId:[
111,222,333,444
],
selectId:111,
selectId:0,
addressList:[]
}
},
onLoad(){
this.initData()
},
methods:{
initData(){
this.selectId = 0;
getDeliveryAddressList().then(res=>{
if (res.return_code == '000000') {
if(res.return_data.length>0){
// console.log(res.return_data)
this.addressList = res.return_data;
this.addressList.map(item=>{
if(item.whetherDefault){
this.selectId = item.id;
}
})
}
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
radioChange(e){
let select = e.detail.value
let content =null;
this.addressList.map(item=>{
if(item.id == select){
content = item;
}
})
let params ={
"id": content.id,
"address": content.address,
"consignee": content.consignee,
"phone": content.phone,
"regionId": content.regionId,
"regionName":content.regionName,
"whetherDefault": true
}
updateDeliveryAddress(params).then(res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
this.selectId = e.detail.value;
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
})
},
editAddress(){
editAddress(id){
uni.navigateTo({
url:"./addNewAddress/addNewAddress?id="+1122
url:"./addNewAddress/addNewAddress?id="+id
})
},
deleteAddress(){
deleteAddress(id){
uni
let _this = this;
uni.showModal({
title: '提示',
content: '确定删除该地址吗?',
success: function(res) {
if (res.confirm) {
let params={
id:id
}
deleteAddress(params).then(res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
_this.initData();
})
} else if (res.cancel) {
// console.log('');
}
}
});
},
//
@ -80,6 +176,7 @@
daoRu(){
uni.chooseAddress({
success: (res) => {
console.log(res)
var data = {
"name": res.userName || '',
"tel": res.telNumber || '',
@ -88,7 +185,7 @@
"county": res.countyName || '',
"address": res.detailInfo || ''
};
// console.log(data)
//
},

@ -1,15 +1,17 @@
<template>
<!-- v-if="specificationList.length>0" -->
<view class="choose-detail" >
<view class="choose-top">
<view class="marRight10">
<image :src="dataList[chooseIndex]" @click="perImage(chooseIndex,dataList)" class="img choose-img " mode="aspectFill"></image>
<image v-if="specificationList[chooseIndex].showImg" :src="imageUrl+specificationList[chooseIndex].showImg" @click="perImage(chooseIndex,imgList)" class="img choose-img " mode="aspectFill"></image>
</view>
<view class="choose-price price-tag marRight10">
<text class="font24">&yen;24.9</text>
<view class="choose-price marRight10">
<text class="" style="text-decoration: line-through;">原价 {{specificationList[chooseIndex].originalPrice}}</text>
</view>
<view class="choose-less-price price-tag ">
<text class="">券后 &yen;24.9</text>
<view class="choose-less-price ">
<text class="">现价 {{specificationList[chooseIndex].price}}</text>
</view>
</view>
@ -38,13 +40,14 @@
<view class="choose-bottom">
<!-- 类型分类 -->
<view class="choose-bottom-title fontwig6 font13 mart10">
颜色分类
选择规格
</view>
<view class="choose-select">
<view v-for="(item,index) in dataList" :key="index" :data-index="index" :class="'choose-item padleft10 mart10 '+ (chooseIndex == index ? 'choose-active':'')" @click="select(index)">
<image :src="item" class="img "></image>
<view class="padleft15 paddtright15 font13">3斤装[量少尝鲜]</view>
<view class="padleft15 paddtright5 fontwig6 font13 fcor999">&yen;18.9</view>
<view v-for="(item,index) in specificationList" :key="index" :data-index="index" :class="'choose-item padleft10 mart10 '+ (chooseIndex == index ? 'choose-active':'')" @click="select(index)">
<image v-if="item.showImg" :src="imageUrl+item.showImg" class="img "></image>
<view class="padleft15 paddtright15 font13"> {{item.name}}</view>
<view class="padleft15 paddtright5 fontwig6 font13 fcor999">{{item.price}}</view>
<view class="padleft15 paddtright5 font13 ">库存{{item.stock}}</view>
</view>
@ -53,13 +56,7 @@
<!-- 数量分类 -->
<view class="choose-bottom-title fontwig6 font13 mart20 choose-num">
<view class="">购买数量</view>
<!-- <view class="choose-change">
<view :class="'number wid25'+(chooseNumber > 1 ? '' :' color999 ') " @click="jianNumber">-</view>
<view class="number width140">{{chooseNumber}}</view>
<view class="number wid25" @click="addNumber">+</view>
</view> -->
<uni-number-box style="transform: scale(0.9);" v-model="chooseNumber" :min="1" @noMoreLess="noMoreLess" @change="changeNumValue" />
<uni-number-box style="transform: scale(0.9);" v-model="chooseNumber" :min="1" :max="specificationList[chooseIndex].stock" @noMoreLess="noMoreLess" @change="changeNumValue" />
</view>
</view>
@ -89,18 +86,23 @@
<script>
import uniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue'
// let listData=require("./data.json")
import {insertShoppingCart,getShoppingCartList} from '@/Utils/physicalObject.js'
const app = getApp();
export default {
data(){
return{
imageUrl: app.globalData.imgUrl,//
chooseIndex:0,
chooseNumber:1,//
// imgList:[],
}
},
props:{
dataList:{
specificationList:{
type:Array,
default:null,
default:[],
},
// 0,1
status:{
@ -111,7 +113,22 @@
components:{
"uni-number-box":uniNumberBox
},
computed:{
imgList(){
if(this.specificationList.length>0){
let arr =[];
this.specificationList.map(item=>{
arr.push(this.imageUrl+item.showImg)
})
return arr;
}else{
return []
}
}
},
methods:{
//
@ -123,24 +140,9 @@
})
},
//
// addNumber(){
// this.chooseNumber = this.chooseNumber+1;
// },
//
// jianNumber(){
// if(this.chooseNumber == 1){
// uni.showToast({
// icon: 'none',
// title: "",
// duration: 1000
// });
// return false;
// }
// this.chooseNumber = this.chooseNumber-1;
// },
changeNumValue(v){
console.log(this.chooseNumber)
this.chooseNumber = v;
},
noMoreLess(){
uni.showToast({
@ -151,8 +153,37 @@
},
//
toCart(){
let params={
goodsId:this.specificationList[this.chooseIndex].goodsId,
num:this.chooseNumber,
sku:this.specificationList[this.chooseIndex].id,
whetherCheck:true
}
insertShoppingCart(params).then(async res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
this.$emit("refreshCartNum")
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
this.$emit("close")
})
},
//
toBuy(){
this.$emit("close")
@ -212,7 +243,7 @@
display: flex;
align-items: center;
height: 160rpx;
color: red;
color: #666666;
.choose-img {
width: 160rpx;
height: 160rpx;

@ -1,27 +1,35 @@
<template>
<view class="">
<!-- v-if="cartList.length>0" -->
<view class="cart-container backcor9">
<scroll-view :scroll-y="true" class="cart-list">
<uni-swipe-action>
<!-- 从这里开始遍历-->
<view v-for="(item,index) in cartList" :class="(item.isFailure?' isFailure ':' ')+'marb10 border-8r backcolorfff paading10'" :key="item.id">
<view v-for="(item,index) in cartList"
:class="(item.isFailure?' isFailure ':' ')+'marb10 border-8r backcolorfff paading10'"
:key="item.id">
<!-- :disabled="item.isFailure" -->
<uni-swipe-action-item :auto-close="autoClose" :right-options="swipe_options" @click="swipe_opt_event" @change="swipe_change($event, item.id)">
<uni-swipe-action-item :auto-close="autoClose" :right-options="swipe_options"
@click="swipe_opt_event($event,item.id)" @change="swipe_change($event, item.id)">
<view class="cart-container2">
<checkbox-group @change="checkClick(item)">
<checkbox class="mycheck" :disabled="!isEdit&&item.isFailure" color="#FFC71E" :value="item.id" :checked="item.checked" />
<checkbox class="mycheck" :disabled="!isEdit&&item.isFailure" color="#FFC71E"
:value="item.id" :checked="item.whetherCheck" />
</checkbox-group>
<view class="cart-detail">
<view class="cart-img">
<image :src="item.img" class="img border-8r" mode="aspectFill"></image>
<image :src="imageUrl+item.img" class="img border-8r" mode="aspectFill"></image>
</view>
<view class="cart-msg">
<view class="">
<view class="cart-msg-title font16 marb10 mart5">{{item.name}}</view>
<view class="cart-msg-parm font13 marb10 fcor777">珍珠米5斤</view>
<view class="cart-msg-title font16 marb10 mart5">{{item.title}}</view>
<view class="cart-msg-parm font13 marb10 fcor777">{{item.skuName|| ''}}
</view>
</view>
<view class="cart-msg-price">
@ -30,8 +38,9 @@
¥{{item.price}}
</view>
<view class="cart-num">
<!-- @blur="blur" @focus="focus" -->
<uni-number-box v-model="item.num" :min="1" @noMoreLess="noMoreLess" @change="changeNumValue" />
<uni-number-box v-model="item.num" :min="1" @noMoreLess="noMoreLess(item.id+'')"
@change="changeNumValue($event,item.id)" />
</view>
</view>
@ -53,12 +62,13 @@
<checkbox-group @change="checkAllClick">
<label>
<!-- :disabled="cartList.length == 0" -->
<checkbox class="mycheck" color="#FFC71E" :value="allCheck.value" :checked="allCheck.checked" />
<checkbox class="mycheck" color="#FFC71E" :value="allCheck.value"
:checked="allCheck.whetherCheck" />
<text class="paddleft5 font16 fcor777">全选</text>
</label>
<!-- -->
</checkbox-group>
<text v-if="!isEdit" class="paddleft5 fcorred" @click="editDelete" >编辑</text>
<text v-if="!isEdit" class="paddleft5 fcorred font16" @click="editDelete">编辑</text>
<text v-if="isEdit" class="icon-ymt delete paddleft5 fcorred" @click="deleteCart"></text>
</view>
@ -75,28 +85,45 @@
</view>
</view>
<!-- <view v-else class="cart-container backcor9">
<view class="">
购物车内暂无商品快去购物吧
</view>
</view> -->
</view>
</template>
<script>
// import cartList from '@/pages/classify/cart-list/cart-list.vue'
import noMore from '@/pages/classify/no-more/no-more.vue'
import uniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue'
import {
getShoppingCartList,
goodsAddNum,
deleteShoppingCart
} from '@/Utils/physicalObject.js'
const app = getApp();
export default {
data() {
return {
imageUrl: app.globalData.imgUrl, //
cartList: [],
checkList: [],
allCheck: {
name: '全选',
checked:false,
whetherCheck: false,
value: 'all'
},
//
swipe_options:[
{
swipe_options: [{
isCheck: false,
text: "收藏",
icon: ' shoucang32 ',
@ -109,8 +136,7 @@
style: {
backgroundColor: '#E64340'
}
}
],
}],
swipe_item_index: null,
numberValue: 0,
cartList: [],
@ -132,7 +158,7 @@
//
var str = 0;
for (var i = 0; i < this.cartList.length; i++) {
if (this.cartList[i].checked) {
if (this.cartList[i].whetherCheck) {
str += this.cartList[i].num * this.cartList[i].price;
}
}
@ -140,30 +166,49 @@
}
},
onLoad() {
this.cartList=[
{id:111,name:"小香风",isFailure:true,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"夏季复古ins风格网红SP同款",price:20,num:1},
{id:222,name:"小香风",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"夏季复古ins风格网红SP同款",price:30,num:1},
{id:333,name:"小香风",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"夏季复古ins风格网红SP同款",price:20,num:1},
{id:444,name:"小香风",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"夏季复古ins风格网红SP同款",price:30,num:1},
]
this.cartList.map(item=>{
this.$set(item, 'checked', false);
})
// this.cartList=[
// {id:111,name:"",isFailure:true,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"insSP",price:20,num:1},
// {id:222,name:"",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"insSP",price:30,num:1},
// {id:333,name:"",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"insSP",price:20,num:1},
// {id:444,name:"",isFailure:false,img:"https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg",title:"insSP",price:30,num:1},
// ]
// this.cartList.map(item=>{
// this.$set(item, 'checked', false);
// })
this.initData();
},
methods: {
initData() {
getShoppingCartList().then(res => {
if (res.return_code == '000000') {
console.log(res.return_data)
this.cartList = res.return_data;
this.allCheckInit();
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
editDelete() {
this.isEdit = !this.isEdit;
if (!this.isEdit) { //退
this.cartList.map(item => {
if(item.checked&&item.isFailure){
item.checked = false;
if (item.whetherCheck && item.isFailure) {
item.whetherCheck = false;
}
})
} else { //
if(this.allCheck.checked){
if (this.allCheck.whetherCheck) {
this.cartList.map(item => {
item.checked = true;
item.whetherCheck = true;
})
}
}
@ -172,54 +217,79 @@
},
//
checkAllClick(e) {
this.allCheck.checked = !this.allCheck.checked;
if (this.allCheck.checked) {
this.allCheck.whetherCheck = !this.allCheck.whetherCheck;
if (this.allCheck.whetherCheck) {
this.cartList.map(item => {
if (!this.isEdit) { //
if (!item.isFailure) {
item.checked = true
item.whetherCheck = true
}
} else { //
item.checked = true
item.whetherCheck = true
}
})
} else {
this.cartList.map(item => {
item.checked = false
item.whetherCheck = false
})
}
},
//
checkClick(item) {
item.checked = !item.checked
item.whetherCheck = !item.whetherCheck;
if (!item.checked) {
if (!item.whetherCheck) {
if (!this.isEdit && !item.isFailure) { //
this.allCheck.checked = false
this.allCheck.whetherCheck = false;
} else if (this.isEdit) {
this.allCheck.checked = false
this.allCheck.whetherCheck = false;
}
} else {
//
const goods = this.cartList.every(item => {
if(!this.isEdit){//
if(item.isFailure){
return true;
}
// //
// const goods = this.cartList.every(item => {
// if(!this.isEdit){//
// if(item.isFailure){
// return true;
// }
// }
// return item.whetherCheck === true
// })
// if (goods) {
// this.allCheck.whetherCheck = true
// } else {
// this.allCheck.whetherCheck = false
// }
this.allCheckInit()
}
},
allCheckInit() {
if(this.cartList.length == 0){
this.allCheck.whetherCheck = false;
return
}
return item.checked === true
//
const goods = this.cartList.every(item => {
// if (!this.isEdit) { //
// if (item.isFailure) {
// return true;
// }
// }
return item.whetherCheck === true
})
if (goods) {
this.allCheck.checked = true
this.allCheck.whetherCheck = true
} else {
this.allCheck.checked = false
}
this.allCheck.whetherCheck = false
}
// console.log(this.allCheck.whetherCheck,goods)
},
//
@ -241,7 +311,7 @@
if (!this.isHaveGoods()) return;
var select = [];
for (var i = 0; i < this.cartList.length; i++) {
if (this.cartList[i].checked) {
if (this.cartList[i].whetherCheck) {
select.push(this.cartList[i].id)
}
}
@ -253,8 +323,9 @@
});
return
} else {
console.log(select,"要移除的商品id")
// console.log(select.join(), "id")
let str=select.join();
this.noMoreLess(str)
}
@ -277,7 +348,7 @@
},
//
swipe_opt_event(e){
swipe_opt_event(e,id) {
console.log(e, "dianji")
if (e.index == 0) { //
@ -296,32 +367,14 @@
}
if (e.index == 1) { //
this.noMoreLess()
this.noMoreLess(id+"")
// this.showAction = 'right';
return
}
// var index = e.index || 0;
// var temp_data_list = this.data_list;
// if(this.swipe_item_index === null) {
// app.globalData.showToast("");
// return false;
// }
// if((temp_data_list[this.swipe_item_index] || null) == null) {
// app.globalData.showToast("");
// return false;
// }
// //
// var id = temp_data_list[this.swipe_item_index]['id'];
// if (index == 0) {
// var goods_id = temp_data_list[this.swipe_item_index]['goods_id'];
// this.goods_favor_delete(id, goods_id, 'favor');
// } else {
// this.cart_delete(id, 'delete');
// }
},
//
swipe_change(e, id) {
@ -329,17 +382,33 @@
// this.swipe_item_index= (e == 'none') ? null : v
},
noMoreLess(){
noMoreLess(ids) {
let _this = this;
uni.showModal({
title: '提示',
content: '确定把该商品移除购物车吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击确定,要删除的id',ids);
let params={ids:ids};
deleteShoppingCart(params).then(res=>{
let title ;
if (res.return_code == '000000') {
title = res.return_data;
}else{
title = res.return_msg;
}
uni.showToast({
title: title,
icon: 'none',
duration: 2000
})
_this.initData();
})
} else if (res.cancel) {
console.log('用户点击取消');
}
@ -347,9 +416,29 @@
});
},
changeNumValue(v){
changeNumValue(v, id) {
// console.log(v,id)
// console.log(this.cartList)
let params = {
id: id
}
goodsAddNum(params).then(res => {
if (res.return_code == '000000') {
uni.showToast({
title: res.return_data,
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
}
@ -359,7 +448,6 @@
</script>
<style lang="scss" scoped>
.bg-white {
background-color: #fff;
}
@ -383,11 +471,13 @@
.mycheck {
// margin:0 20rpx;
}
.cart-detail {
flex: 1;
display: flex;
align-items: center;
padding: 0 10rpx;
.cart-img {
.img {
@ -397,6 +487,7 @@
}
}
.cart-msg {
flex: 1;
align-self: flex-start;
@ -404,22 +495,19 @@
display: flex;
flex-direction: column;
justify-content: space-between;
.cart-msg-title{
}
.cart-msg-parm{
.cart-msg-title {}
.cart-msg-parm {}
}
.cart-msg-price {
display: flex;
align-items: center;
justify-content: space-between;
.cart-price{
}
.cart-num{
.cart-price {}
}
.cart-num {}
}
}
@ -432,6 +520,7 @@
.isFailure {
.cart-img {
position: relative;
:before {
content: '商品失效';
display: block;
@ -468,18 +557,20 @@
display: flex;
justify-content: space-between;
align-items: center;
.select-all {
display: flex;
align-items: center;
}
.tool-right {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
.tool-jiesuan{
}
.tool-jiesuan {}
.jiesuan-btn {
width: 200rpx;
height: 40px;
@ -490,5 +581,4 @@
}
}
}
</style>

@ -2,26 +2,47 @@
<view style="height: 100%;">
<!-- <scroll-view :scroll-y="true" class="ht-auto goods-list" :scroll-top="scroll_top" @scroll="scroll_event" @scrolltolower="scroll_lower" @scrolltoupper="scroll_upper" lower-threshold="30"> -->
<data-list v-if="typeList=='classify'" :page="pageData.pageStart" :size="pageData.pageNum" :selectObject="selectObject" class="ht-auto goods-list" ref="list" @load="handleLoad" @refresherrefresh="refresherrefresh">
<!-- <data-list v-if="typeList=='classify'" :showEmpty="propData.length == 0" :page="pageData.pageStart" :size="pageData.pageNum" :selectObject="selectObject" class="ht-auto goods-list" ref="list" @load="handleLoad" @refresherrefresh="refresherrefresh"> -->
<scroll-view
v-if="typeList=='classify'"
class="scroll-view goods-list"
:scroll-top="scrollTop"
:scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="handleScrolltolower"
@touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
>
<view class="scroll-content1" :style="[scrollContentStyle]">
<!-- 下拉 -->
<view class="pull-down-view">
<view class="refresh-view" >
<text :class="' pull-down-text icon-ymt '+(refreshStatus == 'soon'?' to-blod-down ':refreshStatus == 'sure'?' to-blod-up ':' ') " >{{ refreshText[refreshStatus] }}</text>
</view>
</view>
<view class="scroll-list">
<view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;'">
<view v-if="(propData || null) != null && propData.length > 0" class="oh">
<view v-for="(item, index) in propData" :key="index" >
<view :data-value="112233" @click="goGoodsDetail" class="goods-item bs">
<image :src="item.images" mode="widthFix" class="goods-img"></image>
<view @click="goGoodsDetail(item.id)" class="goods-item bs">
<image :src="imageUrl+item.listImg" mode="widthFix" class="goods-img"></image>
<view class="goods-detail">
<view class="goods-title">
<view class="goods-text">{{item.title}}</view>
<view class="goods-text">{{item.name}}</view>
<!-- <view v-if="(item.simple_desc || null) != null" class="goods-desc">{{item.simple_desc}}</view> -->
<view class="goods-desc">商品的详细信息</view>
<view class="goods-desc">{{item.listDescribe}}</view>
</view>
<view class="goods-item-bottom">
<view class="goods-price">
<view class="new-price">&yen;256</view>
<view class="old-price">&yen;511</view>
<view class="new-price">&yen;{{item.price}}</view>
<view class="old-price">&yen;{{item.originalPrice}}</view>
</view>
<view class="goods-num">
<view class="icon cart cart-class" @click.stop="cartIconChoose">
<view class="icon cart cart-class" @click.stop="cartIconChoose(item.id)">
</view>
</view>
</view>
@ -34,30 +55,53 @@
</view>
</view>
</data-list>
<scroll-view :scroll-y="true" class="ht-auto goods-list" @scrolltolower="scroll_lower" lower-threshold="30">
<view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;'">
<!-- -->
<view class=" empty-content" v-if="propData.length == 0">
<text class="empty-text">{{ emptyText }}</text>
</view>
<!-- 底部上滑 -->
<view class="pull-up-view" >
<view class="load-view" >
<view class="loading-animation" v-if="loadStatus == 'loading'"></view>
<text :class="' loading-text icon-ymt '+(loadStatus == 'soon'?' to-blod-up ':loadStatus == 'sure'?' to-blod-down ':' ') " >{{ loadText[loadStatus] }}</text>
</view>
</view>
</view>
</scroll-view>
<!--search-List -->
<scroll-view v-if="typeList=='goodsSearch'" :scroll-y="true" class="ht-auto goods-list" @scrolltolower="scroll_lower" lower-threshold="30">
<view class="right-content-actual pr bs" :style="'padding-bottom:'+paddBottom+'px;height:100%'">
<view v-if="(propData || null) != null && propData.length > 0" class="oh">
<view v-for="(item, index) in propData" :key="index" >
<view :data-value="112233" @click="goGoodsDetail" class="goods-item bs">
<image :src="item.images" mode="widthFix" class="goods-img"></image>
<view @click="goGoodsDetail(item.id)" class="goods-item bs">
<image :src="imageUrl+item.listImg" mode="widthFix" class="goods-img"></image>
<view class="goods-detail">
<view class="goods-title">
<view class="goods-text">{{item.title}}</view>
<view class="goods-text">{{item.name}}</view>
<!-- <view v-if="(item.simple_desc || null) != null" class="goods-desc">{{item.simple_desc}}</view> -->
<view class="goods-desc">商品的详细信息</view>
<view class="goods-desc">{{item.listDescribe}}</view>
</view>
<view class="goods-item-bottom">
<view class="goods-price">
<view class="new-price">&yen;256</view>
<view class="old-price">&yen;511</view>
<view class="new-price">&yen;{{item.price}}</view>
<view class="old-price">&yen;{{item.originalPrice}}</view>
</view>
<view class="goods-num">
<view class="icon cart cart-class" @click.stop="cartIconChoose">
<view class="icon cart cart-class" @click.stop="cartIconChoose(item.id)">
</view>
</view>
</view>
@ -67,15 +111,31 @@
</view>
<noMore></noMore>
</view>
<!-- -->
<view class=" empty-content" v-else>
<text class="empty-text">{{ emptyText }}</text>
</view>
</view>
</scroll-view>
<!-- 购物车 -->
<view class="gouwuche " @click="goCart">
<!-- cartNum -->
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum+''" type="warning" size="small" />
<view class="icon cart font24px">
</view>
</view>
<!-- 选择类别 -->
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true">
<cart-choose :dataList="goodsPramList" @close="close"></cart-choose>
<cart-choose @refreshCartNum="refreshCartNum" :specificationList="specificationList" @close="close"></cart-choose>
</wybPopup>
</view>
@ -85,25 +145,61 @@
import noMore from '@/pages/classify/no-more/no-more.vue'
import wybPopup from '@/components/wyb-popup/wyb-popup.vue'
import cartChoose from '@/pages/classify/cart-choose/cart-choose.vue'
import dataList from '@/components/dataList/dataList.vue'
import uniloadmore from '@/components/uni-load-more/components/uni-load-more/uni-load-more.vue'
let listData=require("../cart-choose/data.json")
// import dataList from '@/components/dataList/dataList.vue'
// import uniNumberBox from '@/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue'
import { findGoodsSkuByGoodsId,getShoppingCartList } from '@/Utils/physicalObject.js'
import uniBadge from '@/components/uni-badge/components/uni-badge/uni-badge.vue'
const app = getApp();
export default {
data(){
return{
cartNum:0,
imageUrl: app.globalData.imgUrl,//
// start
refresherThreshold:50,
lowerThreshold:50,
pullingDown: false, //
pullDownHeight: 0, //
pullDownTimeStamp: 0, //
pullingUp: false, //
pullUpHeight: 0, //
pullUpTimeStamp: 0, //
maxDistance:100,
touchDirection:'top',
list:[],
emptyText:"暂无数据",
loadStatus: 'soon',
loadText: {
loading: '加载中~',
nomore: '没有更多啦~',
soon: '上滑查看下一分类',
sure: '释放查看下一分类',
},
refreshStatus: 'soon',
refreshText: {
soon: '下滑查看上一分类',
sure: '释放查看上一分类',
nomore: '没有更多啦~',
refreshing: '正在刷新中~'
},
//end
specificationList:[],
goodsPramList:listData.images,//
}
},
created(){
this.refreshCartNum();
},
mounted(){
console.log("挂载了")
},
props: {
propData: {
@ -122,10 +218,6 @@
allData:0
}
},
isFinish:{
type:Boolean,
default:false,
},
selectObject:{
type:Object,
default:{
@ -139,59 +231,275 @@
}
},
watch:{
selectObject:{
handler(n, o) {
if(n.selectIndex == n.length-1){
this.loadStatus = "nomore"
}else{
this.loadStatus = "soon"
}
if(n.selectIndex == 0){
this.refreshStatus = "nomore"
}else{
this.refreshStatus = "soon"
}
},
deep:true, //
immediate:false, //
},
},
computed: {
scrollContentStyle() {
const style = {};
const { pullDownHeight, pullingDown,pullUpHeight, pullingUp } = this;
style.transform = pullingDown ? `translateY(${pullDownHeight}px)` : `translateY(0px)`;
style.transition = pullingDown ? `transform .1s linear` : `transform 0.3s cubic-bezier(0.19,1.64,0.42,0.72)`;
return style;
},
onShow(){
this.get_goods_list();
},
components:{
components:{
wybPopup,
cartChoose,
// uniloadmore,
noMore,
dataList
},
methods:{
uniBadge
// ,
handleLoad(data, callback) {
this.$emit("loadData",callback)
},
// prev,next
refresherrefresh(type){
this.$emit("switchCategory",type)
methods:{
goCart(){
uni.navigateTo({
url:"/pages/classify/cart/cart"
})
},
//
refreshCartNum(){
getShoppingCartList().then( res=>{
if (res.return_code == '000000') {
this.cartNum = res.return_data.length;
// uni.setStorage({
// key:'cartNum', //
// data:res.return_data.length, //
// success(){
// console.log('')
// console.log(app.globalData.cartNum,"this.cartNum")
// }
// })
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
goGoodsDetail(e) {
goGoodsDetail(id) {
uni.navigateTo({
url: '../../classify/goodsDetail/goodsDetail?category_id=' + e.currentTarget.dataset.value
url: '../../classify/goodsDetail/goodsDetail?goodsId=' + id
})
},
//
cartIconChoose(){
//
cartIconChoose(id){
this.specificationList = [];
let params={
goodsId:id
};
console.log(params)
findGoodsSkuByGoodsId(params).then(res=>{
if (res.return_code == '000000') {
if(res.return_data&&res.return_data.length>0){
this.specificationList = res.return_data;
this.$refs.popup.show();
}else{
this.specificationList = [];
}
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//popup
close(){
this.$refs.popup.hide();
},
scroll_lower(){
this.$emit("loadData")
},
//start
//
loadData() {
this.waiting = true;
scroll_lower(){
this.$emit("loadData")
this.$emit('loadData',res => {
this.waiting = false;
this.list = res.list;
this.total = res.total;
this.currentPage++;
this.handleComputeData();
// this.computedHeight();
});
},
//
// computedHeight() {
// },
//
handleComputeData() {
const len = this.list.length;
const total = this.total;
// console.log(len,total)
if (len >= this.total) {
this.loadStatus = 'soon';
} else if (len < this.total) {
this.loadStatus = 'loading';
}
},
//
handleScrolltolower(e) {
this.$emit('scrolltolower', e);
if (this.loadStatus == 'nomore' || this.waiting) return;
this.loadData();
},
//
handleScroll(e) {
// this.currentScrollTop = e.detail.scrollTop;
// if (e.detail.scrollTop <= 20) {
// this.touchDirection = 'top';
// } else {
// this.touchDirection = 'bottom';
// }
// console.log(e.detail.scrollTop)
this.$emit('scroll', e);
},
//
handleTouchStart(e) {
this.pullingDown = true;
this.currentTouchStartY = e.touches[0].clientY;
},
//
handleTouchMove(e) {
//
if (e.touches[0].clientY >= this.currentTouchStartY){
this.touchDirection = 'top';
const currentTouchMoveY = e.touches[0].clientY;
let movingDistance = (currentTouchMoveY - this.currentTouchStartY) ;
if(this.selectObject.selectIndex == 0){
this.refreshStatus = 'nomore'
}
else if(movingDistance > this.refresherThreshold){
this.refreshStatus = 'sure';//
}else{
this.refreshStatus = 'soon';//
}
let computeDistance = movingDistance;
if(computeDistance > this.maxDistance){
computeDistance = this.maxDistance;
}
this.pullDownHeight = computeDistance ;
}else{
//
this.touchDirection = 'bottom';
const currentTouchMoveY = e.touches[0].clientY;
let movingDistance = (this.currentTouchStartY - currentTouchMoveY ) ;
if(this.selectObject.selectIndex == this.selectObject.length-1){
this.loadStatus = 'nomore';
}else if (movingDistance >= this.lowerThreshold) {
this.loadStatus = 'sure';//
} else {
this.loadStatus = 'soon';//
}
let computeDistance = movingDistance;
if(computeDistance > this.maxDistance){
computeDistance = this.maxDistance;
}
this.pullUpHeight = computeDistance;
}
},
//
handleTouchEnd(e) {
//
if(this.touchDirection == 'top'){
if(this.pullDownHeight>=this.refresherThreshold&&this.selectObject.selectIndex > 0){
this.$emit("switchCategory","prev")
}
this.pullingDown = false;
this.pullDownHeight = 0;
//
}else if(this.touchDirection == 'bottom'){
if(this.pullUpHeight>=this.lowerThreshold&&this.selectObject.selectIndex < (this.selectObject.length-1)){
this.$emit("switchCategory","next")
}
this.pullingUp = false;
this.pullUpHeight = 0;
}
},
//
handleInit() {
this.currentPage = this.page;
this.currentSize = this.size;
// console.log()
// this.computedHeight();
},
// end
}
}
</script>
<style scoped>
<style lang="scss" scoped>
//
.gouwuche {
position: absolute;
bottom: 10px;
right: 15px;
width: 25px;
height: 25px;
color: #3DA7E7 !important;
}
.badgeClass {
position: absolute;
top:-5px;
right: -10px;
}
.font24px{
font-size: 24px !important;
color: #F0AD4E;
}
//
.br {
border: 1px solid #ffffff ;
}
@ -217,8 +525,9 @@
.goods-list .goods-img {
/* width: 190rpx; */
height: 190rpx !important;
width: 190rpx;
height: 160rpx !important;
width: 160rpx;
padding: 10rpx;
}
.goods-list .goods-detail {
@ -284,4 +593,159 @@
font-size: 40rpx;
}
/* gundong */
//
.empty-content {
height:calc(100% - 20px) ;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
.empty-image {
width: 100%;
}
.empty-text {
display: block;
color: #606266;
margin-top: 20rpx;
}
}
.scroll-view {
height: 100%;
.scroll-content1{
width: 100%;
height: 100%;
position: relative;
.empty-view {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.pull-down-view {
top: 0;
left: 0;
width: 100%;
padding: 30rpx 0;
display: flex;
position: absolute;
align-items: center;
flex-direction: column;
justify-content: center;
transform: translateY(-100%);
.refresh-view {
display: flex;
align-items: center;
flex-direction: column;
.loading-animation {
width: 50rpx;
height: 50rpx;
}
.pull-down-text {
color: #606266;
font-size: 24rpx;
margin-top: 10rpx;
}
}
}
.scroll-list {
display: flex;
flex-direction: column;
}
.loading-view {
width: 100%;
height: 100%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
.loading-animation {
width: 40rpx;
height: 40rpx;
}
.loading-text {
color: #606266;
font-size: 24rpx;
margin-top: 10rpx;
}
}
.pull-up-view {
width: 100%;
// padding: 15rpx 0;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
.load-view {
display: flex;
align-items: center;
.loading-text {
color: #606266;
font-size: 24rpx;
margin-left: 20rpx;
}
}
}
.loading-animation {
position: relative;
&::after,
&::before {
left: 0;
width: 100%;
position: absolute;
border: 0 solid currentColor;
background-color: #b7b7b7;
}
&::after {
content: '';
top: -25%;
z-index: 1;
height: 100%;
border-radius: 10%;
animation: spin 0.6s -0.1s linear infinite;
}
&::before {
content: '';
bottom: -9%;
height: 10%;
background: #000;
border-radius: 50%;
opacity: 0.2;
animation: shadow 0.6s -0.1s linear infinite;
}
@keyframes spin {
17% {
border-bottom-right-radius: 10%;
}
25% {
transform: translateY(25%) rotate(22.5deg);
}
50% {
border-bottom-right-radius: 100%;
transform: translateY(50%) scale(1, 0.9) rotate(45deg);
}
75% {
transform: translateY(25%) rotate(67.5deg);
}
100% {
transform: translateY(0) rotate(90deg);
}
}
@keyframes shadow {
50% {
transform: scale(1.25, 1);
}
}
}
}
}
</style>

@ -4,12 +4,14 @@
<!-- 搜索框 -->
<block>
<view class="nav-search jianbian">
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="true" propPlaceholder="输入商品名称搜索"></component-search>
<component-search @onsearch="search_button_event" :propIsOnEvent="true" :propIsRequired="true"
propPlaceholder="输入商品名称搜索"></component-search>
</view>
</block>
<!-- 搜索列表 -->
<view class="search-list">
<goodsList :typeList="'goodsSearch'" @loadData="loadData" :propData="data_list" :paddBottom="0"></goodsList>
<goodsList typeList="goodsSearch" @loadData="loadData" :propData="data_list" :paddBottom="0">
</goodsList>
</view>
@ -21,12 +23,21 @@
<script>
import componentSearch from "@/components/search/search.vue";
import goodsList from '@/pages/classify/goods-list/goods-list.vue'
let requestData = require('./data2.json')
import {
getListGoodsDetail
} from '@/Utils/physicalObject.js'
export default {
data() {
return {
data_list:requestData
data_list: [],
keywordsSearh: '',
page: {
pageStart: 1, //
pageNum: 7, //
navigateLastPage: 1, //
allData: 0 //
}
}
},
components: {
@ -36,18 +47,73 @@
methods: {
//
search_button_event(keywords) {
console.log(keywords,"子组件弹射的keywords")
this.keywordsSearh = keywords;
this.data_list = [];
this.page = {
pageStart: 1, //
pageNum: 7, //
navigateLastPage: 1, //
allData: 0 //
}
this.searchData()
// console.log(this.keywordsSearh, "keywords")
},
//
loadData() {
let _this = this;
if (_this.page.pageStart < _this.page.navigateLastPage) {
_this.page.pageStart = _this.page.pageStart + 1;
_this.searchData()
}
},
//
searchData() {
if (!this.keywordsSearh) {
uni.showToast({
title: '请输入商品名称',
duration: 1000,
icon: 'none'
});
return
}
let _this = this
let params = {
title: _this.keywordsSearh,
pageNum: _this.page.pageStart,
pageSize: _this.page.pageNum,
price: 0
}
// params = JSON.stringify(params)
console.log(params)
getListGoodsDetail(params).then(res => {
if (res.return_code == '000000') {
if (res.return_data.list.length > 0) {
_this.data_list = _this.data_list.concat(res.return_data.list);
this.page.pageStart = res.return_data.pageNum;
this.page.pageSize = res.return_data.pageSize;
this.page.total = res.return_data.total;
this.page.navigateLastPage = res.return_data.navigateLastPage
} else {
_this.data_list = []
}
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.search-container {

@ -3,11 +3,11 @@
<!-- 商品主图轮播 -->
<view class="swiper-box">
<swiper circular="true" :autoplay="false" style="height: 188px;" @change="swiperChange">
<swiper-item class="fotct" v-for="(swiper,index) in swiperList" :key="index">
<image mode="heightFix" :src="swiper" @click="perImage(index,swiperList)"></image>
<swiper-item class="fotct" v-for="(swiper,index) in goodsDetail.bannerImg" :key="index">
<image mode="heightFix" :src="swiper" @click="perImage(index,goodsDetail.bannerImg)"></image>
</swiper-item>
</swiper>
<view class="indicator">{{currentSwiper+1}}/{{swiperList.length}}</view>
<view class="indicator">{{currentSwiper+1}}/{{goodsDetail.bannerImg.length}}</view>
</view>
<!-- 商品信息 -->
@ -15,12 +15,12 @@
<!-- 商品信息 -->
<view class="goods-message br bg-white marb10">
<view class="goods-price">
<text>&yen;19.9</text>
<text>&yen;19</text>
<text class="old">&yen;26</text>
</view>
<view class="goods-title">
<view class="goods-text">天友利乐核桃花生奶 180ml*20</view>
<view class="goods-desc">山东好花生</view>
<view class="goods-text">{{goodsDetail.name || ''}}</view>
<view class="goods-desc">{{goodsDetail.listDescribe || ''}}</view>
</view>
</view>
@ -64,8 +64,8 @@
商品详情
</view>
<view style="font-size: 0;">
<image mode="widthFix" class="width100" v-for="(item,index) in swiperList" :key="key" :src="item"
@click="perImage(index,swiperList)">
<image mode="widthFix" class="width100" v-for="(item,index) in goodsDetail.detailImg" :key="key" :src="item"
@click="perImage(index,goodsDetail.detailImg)">
</image>
</view>
<noMore></noMore>
@ -91,7 +91,7 @@
<!-- 选择类别 -->
<wybPopup ref="popup" type="bottom" width="500" scrollY="true" radius="6" :showCloseIcon="true">
<cart-choose :status="1" :dataList="swiperList" @close="close"></cart-choose>
<cart-choose :status="1" @refreshCartNum="refreshCartNum" :specificationList="specificationList" @close="close" ></cart-choose>
</wybPopup>
<!-- 保障 -->
@ -148,33 +148,34 @@
import cartChoose from '@/pages/classify/cart-choose/cart-choose.vue'
import uniGoodsNav from '@/components/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue'
let listData=require("./data.json")
import { findGoodsDetailById ,getShoppingCartList,insertShoppingCart,findGoodsSkuByGoodsId} from '@/Utils/physicalObject.js';
const app = getApp();
export default {
data(){
return{
//
swiperList: [],
couponDesc: [],
imageUrl: app.globalData.imgUrl,//
//
currentSwiper: 0,
isStar:false,
// chooseIndex:0,
// chooseNumber:1,
//
options:[{
icon: 'chat',
text: '客服',
}, {
icon: 'shoucang31',
text: '收藏',
}, {
options:[
// {
// icon: 'chat',
// text: '',
// }, {
// icon: 'shoucang31',
// text: '',
// },
{
icon: 'cart',
text: '购物车',
info: 2,
info: 0,
color:"#646566"
}],
buttonGroup: [{
@ -193,7 +194,11 @@
// scIcon:'shoucang31'
//
goodsId:0,
goodsDetail:null,
specificationList:[]
}
@ -209,6 +214,11 @@
return
}
},
onLoad(options){
this.goodsId = options.goodsId;
this.findGoodsById();
this.refreshCartNum()
},
components:{
wybPopup,
cartChoose,
@ -217,8 +227,6 @@
},
onShow(){
this.swiperList = listData.images;
this.couponDesc = listData;
// if(this.options[1].shoucang == true){
@ -235,11 +243,53 @@
},
methods:{
//
refreshCartNum(){
getShoppingCartList().then( res=>{
if (res.return_code == '000000') {
this.options[0].info = res.return_data.length;
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
findGoodsById(){
let _this = this;
let params ={
id:_this.goodsId
}
findGoodsDetailById(params).then(res=>{
if (res.return_code == '000000') {
this.goodsDetail = res.return_data;
this.goodsDetail.bannerImg = res.return_data.bannerImg.split(",").map(temp=>this.imageUrl + temp);
this.goodsDetail.detailImg = res.return_data.detailImg.split(",").map(temp=>this.imageUrl + temp);
console.log(this.goodsDetail,)
// let list =item.map(temp=>this.imageUrl + temp)
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
showPopup(num) {
if(num == 1){
this.$refs.popup.show();
this.findGoodsSku(this.goodsId);
}else if(num == 2){
this.$refs.popup2.show();
}
@ -255,11 +305,6 @@
},
//
perImage(index,item) {
console.log(index,item)
// uni.previewImage({
// current: 0, //
// urls: [item] //
// })
uni.previewImage({
current: Number(index), //
urls: item //
@ -283,29 +328,31 @@
onClick(e) {
//
//
if(e.index == 0){
console.log("点击客服")
// console.log("")
uni.navigateTo({
url:"/pages/classify/cart/cart"
})
return
}
//
if(e.index == 1){
this.isShowCang = !this.isShowCang;
console.log("点击收藏")
return
// if(e.index == 1){
// this.isShowCang = !this.isShowCang;
// console.log("")
// return
}
// }
//
if(e.index == 2){
console.log("点击去购物车")
uni.navigateTo({
url:"/pages/classify/cart/cart"
})
return
// if(e.index == 2){
// console.log("")
// uni.navigateTo({
// url:"/pages/classify/cart/cart"
// })
// return
}
// }
// uni.showToast({
// title: `${e.content.text}`,
@ -327,9 +374,70 @@
return
}
},
//
toCart(){
let params={
// goodsId:this.specificationList[this.chooseIndex].goodsId,
// num:this.chooseNumber,
// sku:this.specificationList[this.chooseIndex].id,
// whetherCheck:true
}
// insertShoppingCart(params).then(async res=>{
// let title ;
// if (res.return_code == '000000') {
// title = res.return_data;
// this.$emit("refreshCartNum")
// }else{
// title = res.return_msg;
// }
// uni.showToast({
// title: title,
// icon: 'none',
// duration: 2000
// })
// this.$emit("close")
// })
},
//
findGoodsSku(id){
this.specificationList = [];
let params={
goodsId:id
};
findGoodsSkuByGoodsId(params).then(res=>{
if (res.return_code == '000000') {
if(res.return_data&&res.return_data.length>0){
this.specificationList = res.return_data;
this.$refs.popup.show();
}else{
this.specificationList = [];
}
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
}
}
</script>

@ -65,8 +65,7 @@
</view>
</view>
<view class="contconpon width90 border-r"
v-if="minecoupones && couponsDetails.highDiscount.usingRange == 8">
<view class="contconpon width90 border-r" v-if="minecoupones && couponsDetails.highDiscount.usingRange == 8">
<image :src="imagewxUrl+imgadres3" mode="widthFix" class="width100"
v-if="couponsDetails.highDiscountAgentCode.status ==1"></image>
<image :src="imagewxUrl+imgadres2" mode="widthFix" class="width100 mart10"
@ -317,7 +316,6 @@
},
//
receiveDiscount() {
uni.showLoading({
title: '领取中...'
})

@ -170,7 +170,7 @@
export default {
data(){
return{
noteValue:'',
noteValue:'这是备注',
goodsData:{
"images": ["https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg","https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg","https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg","https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg","https://d1.shopxo.vip/static/upload/images/goods/2019/01/14/1547451274847894.jpg"],
},
@ -189,10 +189,10 @@
//
noteBlur(){
console.log(12)
},
noteInput(){
console.log(12)
},
//goods freight,integral,coupon
@ -293,7 +293,7 @@
bottom: 0;
left: 0;
right: 0;
z-index: 999;
z-index: 10;
}
.tool-right{

@ -14,11 +14,11 @@
<view class="top-nav scroll-view-horizontal">
<scroll-view :scroll-x="true" >
<block v-for="(item, index) in category_list" :key="index">
<view :class="' item dis-inline-block ' + (nav_active_index == index ? 'active-class ' : '')" :data-index="index" :data-itemtwoindex="0" @tap="nav_event">
<view :class="' item dis-inline-block ' + (nav_active_index == index ? 'active-class ' : '')" :data-index="index" :data-itemtwoindex="0" @click="nav_event">
<view :class="'icon-content circle br ' + (nav_active_index == index ? 'active-border' : '')">
<image :src="item['big_images']" mode="aspectFit" class="icon-content-img circle"></image>
<image :src="imageUrl+item['img']" mode="aspectFit" class="icon-content-img circle"></image>
</view>
<view class="margin-top-xs">{{item.name}}</view>
<view class="margin-top-xs">{{item.title}}</view>
</view>
</block>
</scroll-view>
@ -28,13 +28,11 @@
<view class="left-nav ">
<scroll-view :scroll-y="true" :scroll-top="scrollTop" class="ht-auto">
<view class="left-content-actual bs tc">
<!-- <view :class="' item ' + (nav_active_item_two_index == -1 ? 'active-class active-border nav-active' : '')" :data-index="nav_active_index" :data-itemtwoindex="-1" :data-itemthreeindex="-1" @tap="nav_event">
<text>全部</text>
</view> -->
<block v-if="(data_content || null) != null && (data_content.items || null) != null && data_content.items.length > 0">
<block v-for="(item, index) in data_content.items" :key="index">
<view :class="' item ' + (nav_active_item_two_index == index ? 'active-class active-border nav-active' : '')" :data-index="nav_active_index" :data-itemtwoindex="index" :data-itemthreeindex="-1" @click="nav_event">
<text>{{item.name}}</text>
<block v-if="(data_content || null) != null && (data_content.children || null) != null && data_content.children.length > 0">
<block v-for="(item, index) in data_content.children" :key="index">
<view :class="' item ' + (nav_active_item_two_index == index ? 'active-class active-border nav-active' : '')" :data-index="nav_active_index" :data-itemtwoindex="index" @click="nav_event">
<text>{{item.title}}</text>
</view>
</block>
</block>
@ -45,9 +43,9 @@
<view class="goods-right-content pa ">
<view class="sort-contain">
<view class="sort-cla">
<view :class=" 'sort '+(sortIndex == 1 ? ' sort-active ' : '') " @tap="sortEvent(1)" >综合</view>
<view :class=" 'sort '+(sortIndex == 2 ? ' sort-active ' : '') " @tap="sortEvent(2)">销量</view>
<view class="sort px " @tap="sortEvent(3)">
<view :class=" 'sort '+(sortIndex == 1 ? ' sort-active ' : '') " @click="sortEvent(1)" >综合</view>
<view :class=" 'sort '+(sortIndex == 2 ? ' sort-active ' : '') " @click="sortEvent(2)">销量</view>
<view class="sort px " @click="sortEvent(3)">
<text :class=" (sortIndex == 3 ? ' sort-active ' : '') ">价格</text>
<view class="pri-px">
<view :class="'icon-ymt to-blod-up ic-pri' +(sortOrder==1? ' sort-active ' : '')"></view>
@ -66,23 +64,24 @@
<!-- 购物车 -->
<view class="gouwuche " @click="goCart">
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" text="45" type="warning" size="small" />
<!-- <view class="gouwuche " @click="goCart">
<uniBadge class="uni-badge-left-margin badgeClass" max-num="99" :text="cartNum" type="warning" size="small" />
<view class="icon cart font24px">
</view>
</view>
</view> -->
</view>
</template>
<script>
import uniBadge from '@/components/uni-badge/components/uni-badge/uni-badge.vue'
const app = getApp();
import componentSearch from "@/components/search/search.vue";
import goodsList from '@/pages/classify/goods-list/goods-list.vue'
const listData = require('./data.json')//
const listData2=require('./data2.json')//
import {getGoodsTypeTree,getListGoodsDetail,getShoppingCartList} from '@/Utils/physicalObject.js'
const app = getApp();
export default {
components: {
componentSearch,
@ -91,11 +90,12 @@
},
data(){
return{
static_dir:"",
businessType:3,//
imageUrl: app.globalData.imgUrl,//
category_list: [],//
nav_active_index: 0,//
nav_active_item_two_index: 0,//
data_content: null,// {}
data_content: null,//{..,children:[]}
scrollTop:0,
selectObject:{
@ -106,37 +106,72 @@
goodsListData: [],//
pageData:{
pageStart:1,
pageNum:7,
allData:7
pageStart:1,//
pageNum:7,//
navigateLastPage:1,//
allData:0 //
},
isFinish:false,
//
sortIndex:1,//
sortIndex:1,// 123
lastOrder:0,
sortOrder:0,//12
sortOrder:0,//12
// cartNum:app.globalData.cartNum,
}
},
onShow() {
created() {
//
this.init();
},
onShow(){
},
methods:{
//
init() {
this.category_list = listData; //
this.data_content = this.category_list[this.nav_active_index] || null;//
this.sortIndex=1; //
this.get_goods_list();//
this.selectObject={
selectIndex:this.nav_active_item_two_index,
length:this.data_content.items.length
uni.showLoading({
title: '加载中',
mask:true,
});
let _this = this;
let params={
businessType:_this.businessType
}
getGoodsTypeTree(params).then(async(res)=>{
if (res.return_code == '000000') {
uni.hideLoading();
if(res.return_data.length>0){
_this.category_list =res.return_data;
_this.data_content = _this.category_list[_this.nav_active_index] || null;//
_this.sortIndex=1; //
if(_this.data_content.children&&_this.data_content.children.length>0){
_this.selectObject={
selectIndex:_this.nav_active_item_two_index,
length:_this.data_content.children.length
};
// console.log(_this.selectObject,"_this.selectObject")
await _this.get_goods_list(_this.data_content.children[_this.nav_active_item_two_index].key);//
}
}
}else{
uni.hideLoading();
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
@ -148,38 +183,89 @@
//
nav_event(e) {
this.nav_active_index = e.currentTarget.dataset.index;//
this.initCategory(e.currentTarget.dataset.itemtwoindex)
this.sortIndex=1;//
this.sortOrder = 0;
this.lastOrder = 0;
this.initCategory(e.currentTarget.dataset.itemtwoindex);
},
initCategory(towIndex){
this.nav_active_item_two_index = towIndex;//
this.data_content = this.category_list[this.nav_active_index] || null;//
this.sortIndex=1;//
this.selectObject={
selectIndex:this.nav_active_item_two_index,
length:this.data_content.items.length
length:this.data_content.children.length
};
this.get_goods_list(this.data_content.id)
this.goodsListData = [];
this.pageData={
pageStart:1,
pageNum:7,
allData:0
}
this.get_goods_list(this.data_content.children[this.nav_active_item_two_index].key)
},
get_goods_list(id){
get_goods_list(key){
setTimeout(()=>{
let price =0;
if(this.sortIndex ==3){
if(this.sortOrder == 1){//
price = 1;
}else if(this.sortOrder == 2){//
price = 2;
}
}
//120
let _this = this;
let params={
goodsType:key,
pageNum:_this.pageData.pageStart,
pageSize:_this.pageData.pageNum,
price:price,
}
console.log(params,"params")
getListGoodsDetail(params).then(res=>{
if (res.return_code == '000000') {
if(res.return_data.list.length > 0){
_this.goodsListData =_this.goodsListData.concat(res.return_data.list);
_this.pageData.pageStart = res.return_data.pageNum;
_this.pageData.pageNum = res.return_data.pageSize;
_this.pageData.allData = res.return_data.total;
_this.pageData.navigateLastPage = res.return_data.navigateLastPage;
console.log(_this.pageData)
}
}else{
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
this.goodsListData = listData2
},2000)
},
loadData(callback){
async loadData(callback){
let _this = this;
if(_this.pageData.pageStart < _this.pageData.allData/_this.pageData.pageNum){
// pageData:{
// pageStart:1,//
// pageNum:7,//
// navigateLastPage:1,//
// allData:0 //
// },
let arr =_this.goodsListData.slice(0,7)
_this.goodsListData = _this.goodsListData.concat(arr);
if(_this.pageData.pageStart < _this.pageData.navigateLastPage){
_this.pageData.pageStart=_this.pageData.pageStart+1;
await _this.get_goods_list(_this.data_content.children[_this.nav_active_item_two_index].key)
}
callback({ list: _this.goodsListData, total: _this.pageData.allData });
@ -192,6 +278,7 @@
}else if(type == 'next'){
this.initCategory(this.nav_active_item_two_index + 1);//1
// console.log(this.nav_active_item_two_index,this.nav_active_item_two_index + 1)
}
this.scrollTop = 40 *(this.nav_active_item_two_index)
@ -201,9 +288,7 @@
//
sortEvent(num) {
this.sortIndex = num ;
this.lastOrder = this.sortOrder;
if(this.sortIndex == 3 ){
if(this.lastOrder == 0){
this.sortOrder = 1
@ -215,30 +300,19 @@
this.sortOrder = 1
}
}else{
this.sortOrder = 0
this.sortOrder = 0;
this.lastOrder = 0;
}
this.initCategory(this.nav_active_item_two_index);
},
goCart(){
uni.navigateTo({
url:"/pages/classify/cart/cart"
})
},
// //
// goGoodsDetail(e) {
// console.log(e,"")
// },
// cartChoose(e){
// console.log(e,"")
// }
}
}
</script>
<style >
<style scoped>
@import url("./classify.css");
.gouwuche {
position: absolute;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -217,36 +217,36 @@
this.getCmsContentcmsContent();
}
// #ifdef H5
uni.getStorage({
key: 'accountId',
success(e) {
if (e.data) {
app.globalData.accountId = e.data;
}
}
})
uni.getStorage({
key: 'gasKey',
success(e) {
if (e.data) {
app.globalData.gasKey = e.data;
}
}
})
uni.getStorage({
key: 'staffCode',
success(e) {
if (e.data) {
if (app.globalData.accountId == '000001&key' || app.globalData.accountId ==
'000000&gasKey' || app.globalData.accountId == '000009&key' || app.globalData
.accountId == '0000010&key') {
app.globalData.staffCode = e.data;
} else {
app.globalData.mchId = e.data;
}
}
}
})
// uni.getStorage({
// key: 'accountId',
// success(e) {
// if (e.data) {
// app.globalData.accountId = e.data;
// }
// }
// })
// uni.getStorage({
// key: 'gasKey',
// success(e) {
// if (e.data) {
// app.globalData.gasKey = e.data;
// }
// }
// })
// uni.getStorage({
// key: 'staffCode',
// success(e) {
// if (e.data) {
// if (app.globalData.accountId == '000001&key' || app.globalData.accountId ==
// '000000&gasKey' || app.globalData.accountId == '000009&key' || app.globalData
// .accountId == '0000010&key') {
// app.globalData.staffCode = e.data;
// } else {
// app.globalData.mchId = e.data;
// }
// }
// }
// })
// #endif
},
onLoad(options) {
@ -578,21 +578,21 @@
url: '/subPages/selectEntry/selectEntry'
})
}
if (e.data == '0000011&key' && app.globalData.h5code) {
uni.navigateTo({
url: '../../goods/externalCoupon/externalCoupon'
})
}
if (e.data == '0000012&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareCounpon/shareCounpon'
})
}
if (e.data == '0000013&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareImgage/shareImgage'
})
}
// if (e.data == '0000011&key' && app.globalData.h5code) {
// uni.navigateTo({
// url: '../../goods/externalCoupon/externalCoupon'
// })
// }
// if (e.data == '0000012&key' && app.globalData.h5code) {
// uni.navigateTo({
// url: '/subPages/shareCounpon/shareCounpon'
// })
// }
// if (e.data == '0000013&key' && app.globalData.h5code) {
// uni.navigateTo({
// url: '/subPages/shareImgage/shareImgage'
// })
// }
}
}
})
@ -771,7 +771,8 @@
.popImg {
width: 100%;
height: 430px;
height: 100%;
min-height: 430px;
}
.h5xfimg {

@ -35,12 +35,12 @@
<view class="width100 font18 fcor333 mart5">优惠券</view>
</view>
<!-- <view style="width: 1px;height: 50px;background-color: #f6f6f6;">
<view style="width: 1px;height: 50px;background-color: #f6f6f6;">
</view>
<view class=" fotct" style="width: 32%;" @click="jumppage(7)">
<view class="width100 font12 fcor333"><text class="font20 marglerig">{{payactivitynum}} </text> </view>
<view class="width100 font18 fcor333 mart5">活动券</view>
</view> -->
</view>
</view>
</view>
@ -252,7 +252,7 @@
onLoad() {
if (!app.globalData.userInfo) {
this.findUser();
// this.queryHzfDiscountTotalNum();
this.queryHzfDiscountTotalNum();
}
},
onReady() {
@ -267,7 +267,7 @@
onShow() {
if (app.globalData.userInfo) {
this.findUser();
// this.queryHzfDiscountTotalNum();
this.queryHzfDiscountTotalNum();
}
// #ifdef MP
if (!app.globalData.userInfo.isSetPayPwd) {

@ -29,10 +29,7 @@
</view>
<view class="right">
<view class="ticket" style="background-color: #009DFF;padding-top: 1vw;">
<view class="num" v-if="row.discountType == 3">
{{row.discountPrice * 10}}
</view>
<view class="num" v-else>
<view class="num">
{{row.discountPrice}}
</view>
<view class="unit margle" v-if="row.discountType == 3">
@ -90,10 +87,7 @@
</view>
<view class="right">
<view class="ticket" style="background-color: #999999;">
<view class="num" v-if="row.discountType == 3">
{{row.discountPrice * 10}}
</view>
<view class="num" v-else>
<view class="num">
{{row.discountPrice}}
</view>
<view class="unit margle" v-if="row.discountType == 3">

@ -21,12 +21,12 @@
let that = this;
// #ifdef MP
app.globalData.accountId = options.accountId;
// uni.switchTab({
// url: '../tabBar/home/home'
// })
uni.switchTab({
url:'../tabBar/classify/classify'
url: '../tabBar/home/home'
})
// uni.navigateTo({
// url: '/subPages/shareImgage/shareImgage'
// })
// #endif
// #ifdef H5
var arr1 = window.location.href;
@ -37,6 +37,69 @@
key: "h5code",
data: arr2[1]
})
uni.getStorage({
key: 'accountId',
success(e) {
if (e.data) {
app.globalData.accountId = e.data;
}
}
})
uni.getStorage({
key: 'gasKey',
success(e) {
if (e.data) {
app.globalData.gasKey = e.data;
}
}
})
uni.getStorage({
key: 'staffCode',
success(e) {
if (e.data) {
if (app.globalData.accountId == '000001&key' || app.globalData.accountId ==
'000000&gasKey' || app.globalData.accountId == '000009&key' || app.globalData
.accountId == '0000010&key') {
app.globalData.staffCode = e.data;
} else {
app.globalData.mchId = e.data;
}
}
}
})
uni.getStorage({
key: 'accountType',
success(e) {
if (e.data) {
app.globalData.accountType = e.data;
}
}
})
// 0011
// 0012
// 0013
// 0014
if (app.globalData.accountType == '0000011&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/pages/goods/externalCoupon/externalCoupon'
})
return;
}
if ((app.globalData.accountType == '0000012&key' || app.globalData.accountType == '0000014&key') && app
.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareCounpon/shareCounpon'
})
return;
}
if (app.globalData.accountType == '0000013&key' && app.globalData.h5code) {
uni.navigateTo({
url: '/subPages/shareImgage/shareImgage'
})
return;
}
uni.switchTab({
url: '../tabBar/home/home'
})
@ -140,7 +203,7 @@
},
jumpcdx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
},
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 72 KiB

@ -312,20 +312,38 @@
});
return false;
}
uni.showToast({
title: '提交订单...',
icon: 'none',
duration: 2000,
success() {
uni.showModal({
title: '请确认充值号码',
content: '充值号码 : ' + that.inputPhone + ',充值成功后无法退款',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '../unionComfirmation/unionComfirmation?orderPrice=' + that.price +
'&payPrice=' + that.inputAmount + '&rechargeContent=' + that.inputPhone +
url: '../unionComfirmation/unionComfirmation?orderPrice=' + that
.price +
'&payPrice=' + that.inputAmount + '&rechargeContent=' + that
.inputPhone +
'&rechargeModel=' + that.amoutType +
'&objectId=' + that.inputAmountId + '&rechargeType=' + that.swiperCurrent
'&objectId=' + that.inputAmountId + '&rechargeType=' + that
.swiperCurrent
})
}
}
})
// uni.showToast({
// title: '...',
// icon: 'none',
// duration: 2000,
// success() {
// uni.navigateTo({
// url: '../unionComfirmation/unionComfirmation?orderPrice=' + that.price +
// '&payPrice=' + that.inputAmount + '&rechargeContent=' + that.inputPhone +
// '&rechargeModel=' + that.amoutType +
// '&objectId=' + that.inputAmountId + '&rechargeType=' + that.swiperCurrent
// })
// }
// })
}
}
}
@ -338,7 +356,8 @@
.popImg {
width: 100%;
height: 430px;
height: 100%;
min-height: 430px;
}
.swiperHead {

@ -1,9 +1,9 @@
<template>
<view>
<image class="width100" mode="widthFix" src="../static/upay3.jpg"></image>
<!-- <image class="width100" mode="widthFix" src="../static/upay3.jpg"></image>
<image class="width94 mart20" mode="widthFix" src="../static/upay4.jpg" @click="jumprecent(1)"></image>
<image class="width94 mart10" mode="widthFix" src="../static/upay2.jpg" @click="jumprecent(2)"></image>
<image class="width94 mart10" mode="widthFix" src="../static/upay1.jpg" @click="jumprecent(3)"></image>
<image class="width94 mart10" mode="widthFix" src="../static/upay1.jpg" @click="jumprecent(3)"></image> -->
<!-- <wybPopup ref="popup" type="center" height="850" width="600" bgColor="" radius="6"
:showCloseIcon="true">
<image class="popImg" :src="imageUrl+imgadres1"></image>

@ -1,6 +1,7 @@
<template>
<view>
<view class="imgshead"></view>
<view class="imgshead backroundimgfit" v-if="partakeWay == 2"></view>
<view class="imgshead backroundimgsed" v-if="partakeWay == 3"></view>
<view class="imgscontent">
<view class="conts paddtop13">
<view v-for="(item,index) in couponList" :key="index" class="conpon border-r height90 flleft marb10 ">
@ -50,21 +51,39 @@
imagewxUrl: app.globalData.imageWxImg,
couponList: [],
shareNum: 0, //
orderNo: ''
orderNo: '', //
partakeWay: '' //
}
},
created() {
if (app.globalData.accountType == '0000012&key') {
this.doShare();
}
},
onShow() {
let that = this;
uni.getStorage({
key: 'shareNum',
success(e) {
that.shareNum = e.data;
if (app.globalData.accountType == '0000012&key') {
uni.removeStorage({
key: 'shareNum'
});
uni.setNavigationBarTitle({
title: '分享领取优惠券'
})
that.partakeWay = 2;
that.getOrderByOutTradeOrder();
}
if (app.globalData.accountType == '0000014&key') {
that.partakeWay = 3;
uni.setNavigationBarTitle({
title: '立即领取优惠券'
})
this.getOrderByOutTradeOrder();
uni.getStorage({
key: 'staffCode',
success: (res) => {
that.getReceiveDiscountList(res.data);
},
})
}
},
methods: {
//
@ -79,7 +98,7 @@
}
getOrderByOutTradeOrder(datas).then(res => {
if (res.return_code == '000000') {
that.getReceiveDiscountList(res.return_data.storeId);
that.getReceiveDiscountList(res.return_data.order.qrCodeSn);
} else {
uni.showToast({
title: res.return_msg,
@ -94,12 +113,13 @@
//
getReceiveDiscountList(items) {
let datas = {
qrCodeSn: items
qrCodeSn: items,
partakeWay: this.partakeWay
// 1000017476
}
getReceiveDiscountList(datas).then(res => {
if (res.return_code == '000000') {
that.couponList = res.return_data;
this.couponList = res.return_data;
} else {
uni.showToast({
title: res.return_msg,
@ -111,6 +131,20 @@
},
//
payReceiveDiscount() {
let that = this;
if (that.partakeWay == 2) {
uni.getStorage({
key: 'shareNum',
success(e) {
if (e.data) {
that.shareNum = e.data;
} else {
that.shareNum = 0;
}
}
})
}
if (app.globalData.userInfo.phone == '' || app.globalData.userInfo.phone == null || app.globalData.userInfo
.phone == undefined) {
uni.showModal({
@ -126,7 +160,7 @@
})
return;
}
if (this.shareNum == 0) {
if (that.shareNum == 0 && that.partakeWay == 2) {
uni.showToast({
title: "分享活动得领取机会",
duration: 2000,
@ -135,9 +169,9 @@
return;
}
let actividatas = [];
for (var i = 0; i < this.couponList.length; i++) {
for (var i = 0; i < that.couponList.length; i++) {
let acid = {
id: this.couponList[i].id
id: that.couponList[i].id
};
actividatas.push(acid);
}
@ -152,11 +186,14 @@
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum - 1
if (that.partakeWay == 2) {
that.shareNum--;
uni.setStorage({
key: "shareNum",
data: this.shareNum
data: that.shareNum
})
}
} else {
uni.showToast({
title: res.return_msg,
@ -168,6 +205,7 @@
},
//
doShare() {
let that = this;
let theUrl = window.location.href.split('#')[0];
let datas = {
url: theUrl
@ -188,9 +226,9 @@
wx.onMenuShareTimeline({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
this.orderNo, //
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', //
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
that.orderNo, //
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//
uni.showToast({
@ -198,10 +236,10 @@
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum + 1;
that.shareNum++;
uni.setStorage({
key: "shareNum",
data: this.shareNum
data: that.shareNum
})
},
cancel: function(r) {},
@ -211,9 +249,9 @@
wx.onMenuShareAppMessage({
title: '分享好友,立获大额优惠券', //
desc: '分享好友,立获大额优惠券', //
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
this.orderNo, //
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', //
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' +
that.orderNo, //
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', //
success: function(res) {
//
uni.showToast({
@ -221,10 +259,10 @@
duration: 2000,
icon: 'none'
})
this.shareNum = this.shareNum + 1;
that.shareNum++;
uni.setStorage({
key: "shareNum",
data: this.shareNum
data: that.shareNum
})
},
cancel: function(r) {},
@ -247,12 +285,19 @@
<style lang="scss">
.imgshead {
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share1.png);
background-size: 100% 230px;
height: 230px;
background-repeat: no-repeat;
}
.backroundimgfit {
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share1.png);
}
.backroundimgsed {
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share4.png);
}
.imgscontent {
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share2.png);
background-size: 100% 320px;

@ -1,6 +1,6 @@
<template>
<view>
<image class="width100" mode="widthFix" src="https://gratia-pay.dctpay.com/filesystem/share/1679038223473.png">
<image class="width100" mode="widthFix" :src="urls">
</image>
</view>
</template>
@ -16,6 +16,9 @@
urls: 'https://gratia-pay.dctpay.com/filesystem/share/1679038223473.png' //
}
},
onLoad() {
this.generateWeChatMpQrCode();
},
methods: {
generateWeChatMpQrCode() {
let that = this;
@ -25,7 +28,8 @@
let datas = {
outTradeNo: res.data,
// 1000017476,
type: 2
type: 2,
systemType: 1
}
generateWeChatMpQrCode(datas).then(res => {
if (res.return_code == '000000') {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

@ -639,7 +639,7 @@
})
uni.reLaunch({
url: '../../pages/user/order_details/order_details?id=' +
this.orderId
that.orderId
})
},
fail: function(err) {

Loading…
Cancel
Save