积分商城

This commit is contained in:
wangh 2023-11-30 18:11:49 +08:00
parent 02bff90102
commit e24a07c0fb
5 changed files with 200 additions and 62 deletions

View File

@ -47,27 +47,42 @@
</view>
<view class="bai-center">
<scroll-view scroll-x="true" class="tap-top">
<view class="sz" v-for="(item,index) in categoryList" :key="index" @click="transferIndex(index) ">
<view class="box" :class="{'xztap': qhindex == index}">{{item.categoryName}}</view>
<view class="gang" v-if="qhindex == index"></view>
<view class="sz" @click="transferIndex(-1)">
<view class="box" :class="{'xztap': qhindex === -1}">全部</view>
<view class="gang" v-if="qhindex === -1"></view>
</view>
<view class="sz" v-for="(item, index) in categoryList" :key="index"
@click="transferIndex(index,item.id)">
<view class="box" :class="{'xztap': qhindex === index}">{{item.categoryName}}</view>
<view class="gang" v-if="qhindex === index"></view>
</view>
</scroll-view>
<view class="wrap-box">
<view class="box-goods" v-for="(item,index) in integralGiftList" :key="index" @click="godetails()">
<view class="box-goods" v-for="(item,index) in integralGiftList" :key="index"
@click="godetails(item)">
<view class="goods-img">
<image :src="baseUrl+'/static/uploadImages/20231106/75bfd9e936974f7a94c2c04e17df1d1b.png'" mode=""></image>
<image :src="baseUrl+'/static/uploadImages/20231106/75bfd9e936974f7a94c2c04e17df1d1b.png'"
mode=""></image>
</view>
<view class="goods-title">
{{item.goodsName}}
{{item.giftName}}
</view>
<view class="good-red">
<view style="display: flex;align-items: center;">
<view class="bi">
<view class="bi" v-if="item.exchangeMethod != '金额'">
<image src="../../static/imgs/jb.png" mode=""></image>
</view>
<view style="color: #FC1708;font-weight: bold;">1992</view>
<view style="color: #FC1708;font-weight: bold;">
<span
v-if="item.exchangeMethod == '积分' || item.exchangeMethod == '积分+金额' || item.exchangeMethod == '积分+加钱购'">{{item.exchangePoints}}</span>
<span v-if="item.exchangeMethod == '积分+金额'">+</span>
<span
v-if="item.exchangeMethod == '金额' || item.exchangeMethod == '积分+金额'">{{item.exchangeAmount}}</span>
</view>
</view>
<view class="hui-time">库存:{{item.remainingInventory === -1?"不限":item.remainingInventory}}
</view>
<view class="hui-time">库存190</view>
</view>
<view class="anniux">
<text>立即兑换</text>
@ -84,18 +99,19 @@
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
categoryList:{},
integralGiftList:{},
categoryList: {},
integralGiftList: {},
title: '',
qhindex: 0,
qhindex: -1,
baseUrl: config.baseUrl,
query: {
categoryId: '',
giftName: '',
deliveryMethod:'',
deliveryMethod: '',
page: 1,
pageSize: 10000
}
@ -111,33 +127,36 @@
this.getIntegralGiftList();
},
methods: {
transferIndex(index) {
transferIndex(index, categoryId) {
this.qhindex = index
if (categoryId == undefined || categoryId == null) {
this.query.categoryId = ''
} else {
this.query.categoryId = categoryId
}
this.getIntegralGiftList()
},
//
getCategoryList() {
request({
url: 'business/integral/integralGiftCategory/queryByPage',
method: 'get',
// params:{}
}).then((res)=>{
if(res.code == 200){
}).then((res) => {
if (res.code == 200) {
this.categoryList = res.data.records
console.log("hello world",res)
}
})
},
//
getIntegralGiftList() {
// let
request({
url: 'business/integral/integralGift/queryByPage',
method: 'get',
// params:data
}).then((res)=>{
if(res.code == 200){
params: this.query
}).then((res) => {
if (res.code == 200) {
this.integralGiftList = res.data.records
console.log("hello world",res)
}
})
},
@ -165,15 +184,27 @@
}
},
godetails() {
godetails(data) {
// uni.$emit('goodsInfo', data)
// uni.$on('goodsInfo', res => {
// // console.log("myArray123", res)
// })
uni.$on('un', function() {
uni.$emit('goodsInfo', data)
})
uni.navigateTo({
url: '/pagesHome/goodsDetails/goodsDetails'
url: '/pagesHome/goodsDetails/goodsDetails',
})
},
goback() {
uni.navigateBack()
}
}
},
onUnload() {
uni.$off('goodsInfo')
},
}
</script>

View File

@ -8,9 +8,10 @@
</view>
<!-- 顶部区域 -->
<view class="centen-siez">
{{setting.signInRules}}
</view>
<view v-html="setting.pointsRules"></view>
</view>
</view>
</view>
</template>
@ -22,16 +23,16 @@
data() {
return {
title: '',
setting:{}
setting: {},
pointsRules: '',
}
},
components: {
},
created() {
this.getSettings();
async onLoad() {
await this.getSettings();
},
methods: {
@ -42,10 +43,9 @@
url: '/business/integral/integralSettings/getByStoreId',
method: 'get',
// params:data
}).then((res)=>{
if(res.code == 200){
}).then((res) => {
if (res.code == 200) {
this.setting = res.data
console.log("hello world",res)
}
})
},
@ -58,9 +58,11 @@
<style scoped lang="scss">
.content {
width: 100%;
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;

View File

@ -1,37 +1,44 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">编辑收货地址</view>
<view class="my-icons"></view>
</view>
<view class="box-gang">
<view class="dataform">
<u-form :model="dataForm" ref="uForm">
<u-form-item label="姓名"><u-input v-model="dataForm.name" /></u-form-item>
</u-form>
</view>
<!-- <view class="box-gang">
<view class="g-name">联系人</view>
<input type="text" placeholder="请填写收货人" />
<input type="text" placeholder="请填写收货人" v-model='name' />
</view>
<view class="box-gang">
<view class="g-name">手机号</view>
<input type="text" placeholder="请填写手机号" />
<input type="text" placeholder="请填写手机号" v-model='mobile' />
</view>
<view class="box-gang">
<view class="g-name">所在地区</view>
<input type="text" placeholder="请填写所在地区" />
<input type="text" placeholder="请填写所在地区" v-model='address' />
</view>
<view class="box-gang">
<view class="g-name">详细地区</view>
<input type="text" placeholder="请填写详细地区" />
<input type="text" placeholder="请填写详细地区" v-model='fullAddress' />
</view>
<view class="box-gang-bt">
<view class="g-name">默认地址</view>
<u-switch v-model="value" @change="change"></u-switch>
</view>
</view> -->
<!-- 顶部区域 -->
<!--
<view class="bottom-anniu" @click="goedit()">
<view class="">提交</view>
</view>
</view> -->
</view>
</view>
</template>
@ -41,7 +48,14 @@
data() {
return {
title: '',
value: true
value: true,
dataForm: {
name: '',
mobile: '',
address: '',
ifDfault: '',
fullAddress: '',
}
}
},
@ -55,6 +69,9 @@
},
goback() {
uni.navigateBack()
},
goedit() {
console.log("123123", this.dataForm)
}
}
}
@ -118,6 +135,11 @@
padding: 15px;
}
.dataform {
margin: 20px auto;
}
.bottom-anniu {
width: 90%;
height: 50px;

View File

@ -8,20 +8,27 @@
</view>
<!-- 顶部区域 -->
<view class="">
<u-swiper :list="list1" height="390" @change="change" @click="click"></u-swiper>
<u-swiper :list="giftImages" height="390" @change="change" @click="click"></u-swiper>
</view>
<view class="bai-box">
<view class="box-title">保养套餐</view>
<view class="box-jg">268积分</view>
<view class="box-title">{{goodsInfo.giftName}}</view>
<view class="box-jg">
<span
v-if="goodsInfo.exchangeMethod == '积分' || goodsInfo.exchangeMethod == '积分+金额' || goodsInfo.exchangeMethod == '积分+加钱购'">{{goodsInfo.exchangePoints}}积分</span>
<span v-if="goodsInfo.exchangeMethod == '积分+金额'">+</span>
<span
v-if="goodsInfo.exchangeMethod == '金额' || goodsInfo.exchangeMethod == '积分+金额'">{{goodsInfo.exchangeAmount}}</span>
</view>
<view class="dt-box">
<view class=""><u-tag text="自提" type="error" shape="circle"></u-tag></view>
<view class="hui-time">市场价89.00</view>
<view class=""><u-tag :text='deliveryMethod' type="error" shape="circle"></u-tag></view>
<view class="hui-time">市场价{{goodsInfo.market}}</view>
</view>
</view>
<view class="bai-box">
<view style="margin-bottom: 10px;">商品详情</view>
<u-line></u-line>
<u-line v-html="goodsInfo.detailedDescription"></u-line>
<!-- <view class="" v-html="html" ></view> -->
</view>
@ -36,24 +43,61 @@
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
title: '',
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
]
goodsInfo: '',
baseUrl: config.baseUrl,
deliveryMethod: '',
giftImages: [],
}
},
components: {
},
onLoad() {
uni.$on('goodsInfo', (data) => {
this.goodsInfo = data
if (this.goodsInfo != null) {
this.dataProcessing()
}
})
uni.$emit('un')
},
methods: {
change() {},
click() {},
dataProcessing() {
if (this.goodsInfo.giftImages != null && this.goodsInfo.giftImages != undefined) {
const myGiftImages = JSON.parse(this.goodsInfo.giftImages);
myGiftImages.forEach(res => {
if (res.fileName == undefined || res.fileName == null) {
this.giftImages.push(res.url)
} else {
let url = this.baseUrl + res.fileName
this.giftImages.push(url);
}
})
}
if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) {
const deliveryData = JSON.parse(this.goodsInfo.deliveryMethod);
this.deliveryMethod = deliveryData.join('+');
} else {
this.deliveryMethod = '无配送信息'
}
},
goorder() {
uni.navigateTo({
url: '/pagesHome/order/order'

View File

@ -51,13 +51,20 @@
<view class="box-bait">
<view class="dis-box">
<view class="goodsimg">
<image src="../../static/logo.png" mode=""></image>
<image :src='baseUrl+goodsInfo.coverImage' mode=""></image>
</view>
<view class="">
<view class="">商品名称</view>
<view class="huyi">市场价2900</view>
<view class="">{{goodsInfo.giftName}}</view>
<view class="huyi">市场价{{goodsInfo.market}}</view>
<view class="btwo">
<view class="">70积分</view>
<view class="">
<span
v-if="goodsInfo.exchangeMethod == '积分' || goodsInfo.exchangeMethod == '积分+金额' || goodsInfo.exchangeMethod == '积分+加钱购'">{{goodsInfo.exchangePoints}}积分</span>
<span v-if="goodsInfo.exchangeMethod == '积分+金额'">+</span>
<span
v-if="goodsInfo.exchangeMethod == '金额' || goodsInfo.exchangeMethod == '积分+金额'">{{goodsInfo.exchangeAmount}}</span>
</view>
<view class="">
<u-number-box v-model="value" @change="valChange" button-size="18"></u-number-box>
</view>
@ -66,7 +73,7 @@
</view>
</view>
<view class="endbox">
<view style="color: #666666;font-size: 14px;">1件商品合计:</view>
<view style="color: #666666;font-size: 14px;">{{value}}件商品合计:</view>
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">140.00</text> 积分</view>
</view>
</view>
@ -93,12 +100,18 @@
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
goodsInfo: '',
title: '',
qhindex: 0,
value: 0,
value: 1,
baseUrl: config.baseUrl,
tapList: [{
text: '到店自提'
},
@ -113,7 +126,33 @@
components: {
},
onLoad() {
uni.$on('goodsInfo', (data) => {
this.goodsInfo = data
if (this.goodsInfo != null) {
this.dataProcessing()
}
})
uni.$emit('un')
},
methods: {
dataProcessing() {
if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) {
const deliveryData = JSON.parse(this.goodsInfo.deliveryMethod);
this.deliveryMethod = deliveryData.join('+');
} else {
this.deliveryMethod = '无配送信息'
}
},
valChange(e) {
console.log('当前值为: ' + e.value)
},