first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:27:25 +08:00
commit 85b89ccea7
1694 changed files with 168292 additions and 0 deletions

98
pages/goods/detail.vue Normal file
View File

@@ -0,0 +1,98 @@
<template>
<view style="background-color: #F7F7F7;">
<u-swiper :list="goodsItem.cover" height="750rpx" indicator indicatorMode="line" circular></u-swiper>
<view style="height: 20rpx;"></view>
<view style="background-color: #ffffff;padding: 30rpx;border-radius: 10rpx;">
<view class="u-flex u-flex-y-center">
<view style="color: #FF1A1A; font-size: 40rpx;font-weight: 800;">{{goodsItem.current_price}}
</view>
<view style="width: 50rpx;"></view>
<view v-if="goodsItem.original_price > goodsItem.current_price"
style="color: #CCCCCC;font-size: 30rpx;text-decoration: line-through;">
{{goodsItem.original_price}}</view>
</view>
<view style="height: 20rpx;"></view>
<view style="color: #232323; font-size: 30rpx;font-weight: 800;">{{ goodsItem.name }}</view>
<view style="height: 20rpx;"></view>
<view class="u-flex" style="color: #666666;font-size: 26rpx;">
<view>库存{{ goodsItem.stock }}</view>
<view style="width: 80rpx;"></view>
<view>销量{{ goodsItem.sales }}</view>
</view>
</view>
<u-divider text="商品详情"></u-divider>
<image v-for="(img,index) in goodsItem.detail" :key="index" :src="img" style="width:750rpx;" mode="widthFix">
</image>
<view style="height: 180rpx;"></view>
<view
style="position: fixed;bottom: 0rpx;width: 750rpx;height:150rpx;background-color: #ffffff;">
<!-- <view class="u-flex u-flex-y-center" style="padding: 0 50rpx;height: 102rpx;">
<view>
<view class="u-flex u-flex-x-center">
<u-icon name="/static/icon/service.png" size="40rpx"></u-icon>
</view>
<view style="color: #232323;font-size: 28rpx;text-align: center;">客服</view>
</view>
</view> -->
<navigator :url="`/pages/order/pre?id=${goodsItem.id}`">
<u-button type="primary">立即下单</u-button>
</navigator>
</view>
</view>
</template>
<script>
let self;
export default {
data() {
return {
show: false,
goodsItem: {
id: '',
cover: [],
original_price: '',
current_price: '',
pre_price: '',
integral: '',
sales: '',
stock: '',
note: ''
}
}
},
onLoad(option) {
self = this;
if (option && option.id) {
self.goodsItem.id = option.id;
} else {
uni.navigateBack();
}
self.getGoodsItem();
},
methods: {
open() {
// console.log('open');
},
close() {
self.show = false
// console.log('close');
},
getGoodsItem() {
self.$http.get('/shop/v10/goods/item', {
id: self.goodsItem.id
}).then(({
data
}) => {
self.goodsItem = data;
})
},
}
}
</script>
<style lang="scss">
</style>

122
pages/goods/device.vue Normal file
View File

@@ -0,0 +1,122 @@
<template>
<view style="background-color: #F7F7F7;">
<u-swiper :list="goodsItem.cover" height="750rpx" indicator indicatorMode="line" circular></u-swiper>
<view>
<view style="height: 30rpx;"></view>
<view style="background-color: #ffffff;padding: 30rpx;border-radius: 16rpx;">
<view class="u-flex u-flex-y-center">
<view style="color: #FF1A1A; font-size: 40rpx;font-weight: 800;">{{goodsItem.current_price}}
</view>
<view style="width: 50rpx;"></view>
<view v-if="goodsItem.original_price > goodsItem.current_price"
style="color: #CCCCCC;font-size: 30rpx;text-decoration: line-through;">
{{goodsItem.original_price}}</view>
</view>
<view style="height: 20rpx;"></view>
<view style="color: #232323; font-size: 30rpx;font-weight: 800;">{{ goodsItem.name }}</view>
<view style="height: 20rpx;"></view>
<view class="u-flex" style="color: #666666;font-size: 26rpx;">
<view>销量{{ goodsItem.sales }}</view>
<view style="width: 80rpx;"></view>
<view>库存{{ goodsItem.stock }}</view>
<view style="width: 80rpx;"></view>
<view v-if="goodsItem.integral">赠送积分{{ goodsItem.integral }}</view>
</view>
</view>
</view>
<view style="height:20rpx;"></view>
<u-divider text="详情"></u-divider>
<image v-for="(img,index) in goodsItem.detail" :key="index" :src="img" style="width:750rpx;" mode="widthFix">
</image>
<view style="height: 100rpx;"></view>
<view
style="position: fixed;bottom: 0rpx; box-shadow: 2px 2px 2px 2px black;height: 102rpx;width: 750rpx;background-color: #ffffff;">
<view class="u-flex u-flex-y-center u-flex-between" style="padding: 0 50rpx;height: 102rpx;">
<button open-type="contact" class="xkl-clear-btn">
<view class="u-flex u-flex-x-center">
<u-icon name="/static/img/service.png" size="40rpx"></u-icon>
</view>
<view style="color: #232323;font-size: 28rpx;text-align: center;">客服</view>
</button>
<view @click="toauth()">
<button class="xkl-clear-btn" style="width: 236rpx;height: 70rpx;line-height: 70rpx;font-size: 28rpx;background: #FFFFFF;border-radius: 8rpx 8rpx 8rpx 8rpx;
opacity: 1;
border: 2rpx solid #707070;">立即下单</button>
</view>
</view>
</view>
</view>
</template>
<script>
import {
API_URL,
STATIC_URL
} from '@/env'
let self;
export default {
data() {
return {
show: false,
goodsItem: {
id: '',
cover: [],
original_price: '',
current_price: '',
pre_price: '',
integral: '',
sales: '',
stock: '',
note: ''
},
num: 1
}
},
onLoad(option) {
self = this;
},
onShow() {
self.getGoodsItem();
},
methods: {
toauth() {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/micromessenger/i) == 'micromessenger') {
location.href =
`${API_URL}/shop/v10/auth/wxoauth?path=${`/pages/order/pre?id=${self.goodsItem.id}&num=${self.num}`}`;
return true;
} else {
uni.navigateTo({
url: `/pages/order/pre?id=${self.goodsItem.id}&num=${self.num}`
})
}
return
},
open() {
// console.log('open');
},
close() {
self.show = false
// console.log('close');
},
getGoodsItem() {
self.$http.get('/shop/v10/goods/item', {
type: 1
}).then(({
data,
success
}) => {
if (success) {
self.goodsItem = data;
}
})
},
}
}
</script>
<style lang="scss">
</style>

124
pages/goods/level.vue Normal file
View File

@@ -0,0 +1,124 @@
<template>
<view class="xkl-com-bg">
<view style="height: 20rpx;"></view>
<view>
<navigator :url="`/pages/order/pre?id=${goodsItem.id}&num=1`"
class="u-flex"
style="background-color: #ffffff;padding: 20rpx;margin-bottom: 20rpx; border-radius: 10rpx;font-size: 30rpx;">
<u--image width="220rpx" height="220rpx" :src="goodsItem.cover[0]" radius="16rpx"></u--image>
<view style="padding: 20rpx;width: 100%;">
<view style="color: #232323;">{{goodsItem.name}}</view>
<view style="height: 10rpx;"></view>
<view>
<text>单价</text>
<text style="color: crimson;">
{{goodsItem.current_price}}
</text>
</view>
<view style="height: 10rpx;"></view>
<view class="u-flex u-flex-between">
<view>
<text>购买数量</text>
<text style="color: crimson;">1</text>
</view>
<view style="color: #7999C3;">下单</view>
</view>
</view>
</navigator>
<navigator :url="`/pages/order/pre?id=${goodsItem.id}&num=${item.need_num}`"
v-for="(item,index) in levelItems" :key="index" class="u-flex"
style="background-color: #ffffff;padding: 20rpx;margin-bottom: 20rpx; border-radius: 10rpx;font-size: 30rpx;">
<u--image width="220rpx" height="220rpx" :src="goodsItem.cover[0]" radius="16rpx"></u--image>
<view style="padding: 20rpx;width: 100%;">
<view class="u-flex u-flex-between">
<view style="color: #232323;">{{goodsItem.name}}</view>
<view>
<text style="font-size: 28rpx;color: #999999;">升级到</text>
<text style="color: #26418A;font-size: 32rpx;font-weight: 700;">v{{item.level}}</text>
</view>
</view>
<view style="height: 10rpx;"></view>
<view>
<text>单价</text>
<text style="color: crimson;">
{{goodsItem.current_price}}
</text>
</view>
<!-- <view style="height: 10rpx;"></view>
<view>
<text>总价</text>
<text style="color: crimson;">
{{item.total_price}}
</text>
</view> -->
<view style="height: 10rpx;"></view>
<view class="u-flex u-flex-between">
<view>
<text>所需数量</text>
<text style="color: crimson;">
{{item.need_num}}
</text>
</view>
<view style="color: #7999C3;">下单</view>
</view>
</view>
</navigator>
</view>
<view style="height: 100rpx;"></view>
</view>
</template>
<script>
let self;
export default {
data() {
return {
levelItems: [],
goodsItem: {
id: '',
cover: [],
name: '',
original_price: '',
current_price: '',
pre_price: '',
integral: '',
sales: '',
stock: '',
note: ''
},
}
},
onLoad() {
self = this;
},
onShow(option) {
self.getGoodsLevel();
},
onPullDownRefresh() {
self.getGoodsLevel();
uni.stopPullDownRefresh();
},
methods: {
open() {
// console.log('open');
},
close() {
self.show = false
// console.log('close');
},
getGoodsLevel() {
self.$http.get('/shop/v10/goods/level').then(({
data
}) => {
self.goodsItem = data.goods;
self.levelItems = data.level;
})
},
}
}
</script>
<style lang="scss">
</style>