提交修改
@@ -1,6 +1,6 @@
|
|||||||
// const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044
|
// const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044
|
||||||
// const baseUrl = "https://api.collect.xyh.muzili.top/"; //这里放置url域名32044
|
// const baseUrl = "https://api.collect.xyh.muzili.top/"; //这里放置url域名32044
|
||||||
const baseUrl = "https://cb.hnxinyouhe.com/"; //这里放置url域名32044
|
const baseUrl = "https://bsh.info.yw.hnzhwlkj.cn/"; //这里放置url域名32044
|
||||||
// const baseUrl = "https://114.215.24.240:8106/api/v1/"; //这里放置url域名32044
|
// const baseUrl = "https://114.215.24.240:8106/api/v1/"; //这里放置url域名32044
|
||||||
export function request(options){//封装的requset
|
export function request(options){//封装的requset
|
||||||
let { url,data,method } = options;
|
let { url,data,method } = options;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="content" @click="handleView">
|
<view class="content">
|
||||||
<u-read-more :showHeight="80" ref="uReadMore" color="#999999" closeText="查看更多">
|
<u-read-more :showHeight="80" ref="uReadMore" color="#999999" closeText="查看更多">
|
||||||
<rich-text :nodes="item.content" @load="handleContentLoad"></rich-text>
|
<rich-text :nodes="item.content" @load="handleContentLoad"></rich-text>
|
||||||
</u-read-more>
|
</u-read-more>
|
||||||
@@ -190,12 +190,13 @@ export default {
|
|||||||
color: #3BC6BD;
|
color: #3BC6BD;
|
||||||
}
|
}
|
||||||
.chat-btn2{
|
.chat-btn2{
|
||||||
background: rgb(255 0 0 / 20%);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.chat-btn3{
|
|
||||||
background: rgb(62 94 215 / 20%);
|
background: rgb(62 94 215 / 20%);
|
||||||
color: #3E5ED7;
|
color: #3E5ED7;
|
||||||
|
|
||||||
|
}
|
||||||
|
.chat-btn3{
|
||||||
|
background: rgb(255 0 0 / 20%);
|
||||||
|
color: #FF0000;
|
||||||
}
|
}
|
||||||
.chat-btn4{
|
.chat-btn4{
|
||||||
background: rgb(105 105 105 / 20%);
|
background: rgb(105 105 105 / 20%);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
animationDuration: item.speed + 's',
|
animationDuration: item.speed + 's',
|
||||||
color: item.color
|
color: item.color
|
||||||
}"
|
}"
|
||||||
|
@animationend="finishDanmu(item.id, item.lane)"
|
||||||
>
|
>
|
||||||
{{ item.text }}
|
{{ item.text }}
|
||||||
</view>
|
</view>
|
||||||
@@ -26,7 +27,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
danmuItems: [],
|
danmuItems: [],
|
||||||
laneBusy: [] // 轨道是否被占用
|
laneBusy: [], // 轨道是否被占用
|
||||||
|
pendingQueue: [] // 等待队列
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -39,30 +41,35 @@ export default {
|
|||||||
startDanmu() {
|
startDanmu() {
|
||||||
let index = 0
|
let index = 0
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const text = this.list[index].content
|
if (this.list && this.list.length > 0) {
|
||||||
this.createDanmu(text)
|
const text = this.list[index].content
|
||||||
index = (index + 1) % this.list.length
|
this.createDanmu(text)
|
||||||
}, 1500)
|
index = (index + 1) % this.list.length
|
||||||
|
}
|
||||||
|
}, 2200)
|
||||||
},
|
},
|
||||||
|
|
||||||
createDanmu(text) {
|
createDanmu(text) {
|
||||||
const lane = this.getFreeLane()
|
const lane = this.getFreeLane()
|
||||||
|
|
||||||
|
// 如果没有空闲轨道,加入等待队列
|
||||||
|
if (lane === -1) {
|
||||||
|
this.pendingQueue.push(text)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const id = Date.now() + Math.random()
|
const id = Date.now() + Math.random()
|
||||||
|
|
||||||
const item = {
|
const item = {
|
||||||
id,
|
id,
|
||||||
text,
|
text,
|
||||||
top: lane * 100, // 每条轨道高度 60rpx
|
top: lane * 80 + 20, // 每条轨道高度 80rpx,顶部留20rpx间距
|
||||||
speed: 6 + Math.random()*2,
|
speed: 14 + Math.random()*6,
|
||||||
color: this.randomColor(),
|
color: this.randomColor(),
|
||||||
lane
|
lane
|
||||||
}
|
}
|
||||||
|
|
||||||
this.danmuItems.push(item)
|
this.danmuItems.push(item)
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
this.finishDanmu(id, lane)
|
|
||||||
}, item.speed * 1000)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getFreeLane() {
|
getFreeLane() {
|
||||||
@@ -73,15 +80,26 @@ export default {
|
|||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果都满了,就随机一个
|
// 如果都满了,返回-1,不创建弹幕
|
||||||
return Math.floor(Math.random() * this.row)
|
return -1
|
||||||
},
|
},
|
||||||
|
|
||||||
finishDanmu(id, lane) {
|
finishDanmu(id, lane) {
|
||||||
|
// 移除弹幕项
|
||||||
this.danmuItems = this.danmuItems.filter(i => i.id !== id)
|
this.danmuItems = this.danmuItems.filter(i => i.id !== id)
|
||||||
|
|
||||||
// 整个动画跑完后释放轨道
|
// 释放轨道
|
||||||
this.laneBusy[lane] = false
|
if (lane !== undefined && lane >= 0) {
|
||||||
|
this.laneBusy[lane] = false
|
||||||
|
|
||||||
|
// 检查等待队列,如果有等待的弹幕,立即创建
|
||||||
|
if (this.pendingQueue.length > 0) {
|
||||||
|
const text = this.pendingQueue.shift()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.createDanmu(text)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
randomColor() {
|
randomColor() {
|
||||||
@@ -96,7 +114,7 @@ export default {
|
|||||||
.danmu-container {
|
.danmu-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 88rpx;
|
top: 450rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 600rpx;
|
height: 600rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -115,10 +133,14 @@ export default {
|
|||||||
background: rgb(0 0 0 / 60%);
|
background: rgb(0 0 0 / 60%);
|
||||||
padding: 5px 14px;
|
padding: 5px 14px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
|
line-height: 1.5;
|
||||||
|
max-width: 600rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes danmu-move {
|
@keyframes danmu-move {
|
||||||
from { transform: translateX(0); }
|
from { transform: translateX(0); }
|
||||||
to { transform: translateX(-1200rpx); }
|
to { transform: translateX(-150vw); }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -94,22 +94,18 @@
|
|||||||
"versionCode" : 100
|
"versionCode" : 100
|
||||||
},
|
},
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wx2f5476b2243ae858",
|
"appid" : "wx62c3f16d37f2c2a2",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
"postcss" : true
|
"postcss" : true
|
||||||
},
|
},
|
||||||
"permission": {
|
"permission" : {
|
||||||
"scope.userFuzzyLocation": {
|
"scope.userFuzzyLocation" : {
|
||||||
"desc": "用于为你推荐附近内容/门店"
|
"desc" : "用于为你推荐附近内容/门店"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"requiredPrivateInfos": [
|
"requiredPrivateInfos" : [ "getFuzzyLocation", "chooseLocation", "chooseAddress" ],
|
||||||
"getFuzzyLocation",
|
|
||||||
"chooseLocation",
|
|
||||||
"chooseAddress"
|
|
||||||
],
|
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"uniStatistics" : {
|
"uniStatistics" : {
|
||||||
"enable" : true
|
"enable" : true
|
||||||
|
|||||||
@@ -182,18 +182,18 @@
|
|||||||
"selectedIconPath": "/static/image/classify.png",
|
"selectedIconPath": "/static/image/classify.png",
|
||||||
"text": "分类"
|
"text": "分类"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"pagePath": "pages/publish/index",
|
|
||||||
"iconPath": "/static/image/publish1.png",
|
|
||||||
"selectedIconPath": "/static/image/publish.png",
|
|
||||||
"text": "发布"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"pagePath": "pages/square/index",
|
"pagePath": "pages/square/index",
|
||||||
"iconPath": "/static/image/square1.png",
|
"iconPath": "/static/image/square1.png",
|
||||||
"selectedIconPath": "/static/image/square.png",
|
"selectedIconPath": "/static/image/square.png",
|
||||||
"text": "广场"
|
"text": "广场"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/publish/index",
|
||||||
|
"iconPath": "/static/image/publish1.png",
|
||||||
|
"selectedIconPath": "/static/image/publish.png",
|
||||||
|
"text": "发布"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/index/mine",
|
"pagePath": "pages/index/mine",
|
||||||
"iconPath": "/static/image/mine1.png",
|
"iconPath": "/static/image/mine1.png",
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="page">
|
<view class="page">
|
||||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#000" backgroundColor="#fff" :statusBar="true" title="样机分类"></uni-nav-bar>
|
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#000" backgroundColor="#fff" :statusBar="true" title="样机分类"></uni-nav-bar>
|
||||||
|
<!--搜索 -->
|
||||||
|
<view class="search">
|
||||||
|
<uni-search-bar @confirm="search" v-model="searchValue" cancelButton="none" @blur="search"></uni-search-bar>
|
||||||
|
</view>
|
||||||
<!-- 顶部 tabs -->
|
<!-- 顶部 tabs -->
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
<view :class="['tab', currentTab==='latest'?'on':'']" @click="switchTab('latest')">最新发布</view>
|
<view :class="['tab', currentTab==='latest'?'on':'']" @click="switchTab('latest')">最新发布</view>
|
||||||
@@ -97,6 +100,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
searchValue:'',
|
||||||
showlogin: false,
|
showlogin: false,
|
||||||
tabs: [
|
tabs: [
|
||||||
{ key: 'latest', label: '最新发布' },
|
{ key: 'latest', label: '最新发布' },
|
||||||
@@ -229,9 +233,9 @@ export default {
|
|||||||
// 分类切换事件
|
// 分类切换事件
|
||||||
onCategoryChange(categoryId) {
|
onCategoryChange(categoryId) {
|
||||||
// 如果点击的是当前分类且已有数据,不重复加载
|
// 如果点击的是当前分类且已有数据,不重复加载
|
||||||
if (this.currentCategoryId === categoryId && this.slist.length > 0) {
|
// if (this.currentCategoryId === categoryId && this.slist.length > 0) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
// 切换分类时,重置所有状态
|
// 切换分类时,重置所有状态
|
||||||
this.currentCategoryId = categoryId;
|
this.currentCategoryId = categoryId;
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
@@ -242,6 +246,10 @@ export default {
|
|||||||
this.slist = []; // 先清空数据
|
this.slist = []; // 先清空数据
|
||||||
this.loadCategoryData(categoryId, false);
|
this.loadCategoryData(categoryId, false);
|
||||||
},
|
},
|
||||||
|
search(res){
|
||||||
|
console.log(res.value)
|
||||||
|
this.loadCategoryData('', false);
|
||||||
|
},
|
||||||
|
|
||||||
// 根据分类id加载分类下的内容
|
// 根据分类id加载分类下的内容
|
||||||
loadCategoryData(categoryId, isLoadMore = false) {
|
loadCategoryData(categoryId, isLoadMore = false) {
|
||||||
@@ -272,7 +280,8 @@ export default {
|
|||||||
current:this.page,
|
current:this.page,
|
||||||
size:10,
|
size:10,
|
||||||
status:1,
|
status:1,
|
||||||
category_id:categoryId
|
category_id:categoryId,
|
||||||
|
keyword:this.searchValue
|
||||||
};
|
};
|
||||||
// 添加排序参数(如果后端支持)
|
// 添加排序参数(如果后端支持)
|
||||||
if(this.currentTab=='near'){
|
if(this.currentTab=='near'){
|
||||||
@@ -334,6 +343,32 @@ export default {
|
|||||||
},
|
},
|
||||||
// tab 切换
|
// tab 切换
|
||||||
switchTab(key) {
|
switchTab(key) {
|
||||||
|
if((this.longitude==''||this.latitude=='')&&key=='near'){
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先授权地理位!',
|
||||||
|
content: '请在设置中开启模糊定位权限',
|
||||||
|
confirmText: '去设置',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.openSetting({
|
||||||
|
success: (setRes) => {
|
||||||
|
if (setRes.authSetting['scope.userFuzzyLocation']) {
|
||||||
|
that.getFuzzy().then(res => {
|
||||||
|
that.latitude = res.latitude
|
||||||
|
that.longitude = res.longitude
|
||||||
|
console.log(res);
|
||||||
|
}).catch(err => console.error(err));
|
||||||
|
} else {
|
||||||
|
reject(new Error('未开启模糊定位权限'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (this.currentTab === key) return
|
if (this.currentTab === key) return
|
||||||
this.currentTab = key
|
this.currentTab = key
|
||||||
this.onRefresh()
|
this.onRefresh()
|
||||||
@@ -477,6 +512,9 @@ page,
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
/* background: #f7f7f7; */
|
/* background: #f7f7f7; */
|
||||||
}
|
}
|
||||||
|
.search{
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.tabs {
|
.tabs {
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
@@ -520,17 +558,18 @@ page,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content-con {
|
.content-con {
|
||||||
height: calc(100% - 80rpx);
|
height: calc(100% - 260rpx);
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left-aside {
|
.left-aside {
|
||||||
width: 200rpx;
|
width: 22%;
|
||||||
background: #3BC6BD;
|
background: #3BC6BD;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.f-item {
|
.f-item {
|
||||||
height: 96rpx;
|
height: 96rpx;
|
||||||
|
width: 100%;
|
||||||
/* padding-left: 28rpx; */
|
/* padding-left: 28rpx; */
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -554,7 +593,8 @@ page,
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.right-aside {
|
.right-aside {
|
||||||
flex: 1;
|
/* flex: 1; */
|
||||||
|
width: 78%;
|
||||||
/* background: #fff; */
|
/* background: #fff; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
<view class="page">
|
<view class="page">
|
||||||
<z-paging ref="paging" :auto="false" v-model="list" @query="queryList" empty-view-text="暂无数据!">
|
<z-paging ref="paging" :auto="false" v-model="list" @query="queryList" empty-view-text="暂无数据!">
|
||||||
<!-- 顶部背景 -->
|
<!-- 顶部背景 -->
|
||||||
|
<uni-nav-bar leftText=" " :fixed="true" :border="false" color="#000000" backgroundColor="#3BC8BE" :statusBar="true" title="西门子样机福利平台"></uni-nav-bar>
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<image src="/static/image/homebg.png" mode="aspectFill" class="bg"></image>
|
<swiper class="banner-swiper" circular autoplay :interval="4000" indicator-dots indicator-color="rgba(255,255,255,.4)"
|
||||||
|
indicator-active-color="#3F435B">
|
||||||
<!-- 弹幕组件 -->
|
<swiper-item v-for="(banner,index) in bannerList" :key="index">
|
||||||
<danmu :list="danmuList" :row="5" :visible="danmuVisible"></danmu>
|
<image class="banner-img" :src="banner.image_url_pull" mode="aspectFill"></image>
|
||||||
|
</swiper-item>
|
||||||
<!-- 标题 -->
|
</swiper>
|
||||||
<view class="title">
|
<view class="homemap">
|
||||||
<view>西门子样机</view>
|
<image
|
||||||
<view>福利平台</view>
|
class="homemap-img"
|
||||||
|
:src="homemapurl"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 弹幕组件 -->
|
||||||
|
<danmu :list="danmuList" :row="6" :visible="danmuVisible"></danmu>
|
||||||
|
|
||||||
<!-- 右侧按钮 -->
|
<!-- 右侧按钮 -->
|
||||||
<view class="right-btns">
|
<view class="right-btns">
|
||||||
@@ -74,18 +80,26 @@ export default {
|
|||||||
content:'',
|
content:'',
|
||||||
list:[],
|
list:[],
|
||||||
danmuList: [],
|
danmuList: [],
|
||||||
|
bannerList:[],
|
||||||
latitude:'',
|
latitude:'',
|
||||||
longitude:''
|
longitude:'',
|
||||||
|
bannerurl:'',
|
||||||
|
banner:uni.getStorageSync('banner'),
|
||||||
|
homemapurl:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// 数据加载逻辑
|
// 数据加载逻辑
|
||||||
if (!uni.getStorageSync('token')) {
|
if (!uni.getStorageSync('token')) {
|
||||||
this.mini_login().then(() => {
|
this.mini_login().then(() => {
|
||||||
|
this.bannerListfn()
|
||||||
|
this.configListfn()
|
||||||
this.barragelist()
|
this.barragelist()
|
||||||
this.$refs.paging && this.$refs.paging.reload()
|
this.$refs.paging && this.$refs.paging.reload()
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
this.bannerListfn()
|
||||||
|
this.configListfn()
|
||||||
this.barragelist()
|
this.barragelist()
|
||||||
this.$refs.paging && this.$refs.paging.reload()
|
this.$refs.paging && this.$refs.paging.reload()
|
||||||
}
|
}
|
||||||
@@ -97,7 +111,82 @@ export default {
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
}).catch(err => console.error(err));
|
}).catch(err => console.error(err));
|
||||||
},
|
},
|
||||||
|
onTabItemTap() {
|
||||||
|
this.reloadPage()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
configListfn(){
|
||||||
|
request({
|
||||||
|
url:'common/config/find',
|
||||||
|
method:'get',
|
||||||
|
data:{
|
||||||
|
code:'home_map'
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
const homemapurl = res.data.data.value_pull
|
||||||
|
const EXPIRE_TIME = 2 * 60 * 60 * 1000
|
||||||
|
const cache = uni.getStorageSync('homemapurl')
|
||||||
|
let useCache = false
|
||||||
|
// 1️⃣ 缓存存在 + 未过期 + url 相同 → 用缓存
|
||||||
|
if (
|
||||||
|
cache &&
|
||||||
|
cache.time &&
|
||||||
|
Date.now() - cache.time < EXPIRE_TIME &&
|
||||||
|
cache.data === homemapurl
|
||||||
|
) {
|
||||||
|
useCache = true
|
||||||
|
this.homemapurl = uni.getStorageSync('homemapurl')
|
||||||
|
}
|
||||||
|
// 2️⃣ 否则更新缓存
|
||||||
|
if (!useCache) {
|
||||||
|
uni.setStorageSync('banner', {
|
||||||
|
data: homemapurl,
|
||||||
|
time: Date.now()
|
||||||
|
})
|
||||||
|
uni.setStorageSync('homemapurl', homemapurl)
|
||||||
|
this.homemapurl = homemapurl
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bannerListfn(){
|
||||||
|
request({
|
||||||
|
url:'common/banner/list',
|
||||||
|
method:'get',
|
||||||
|
data:{
|
||||||
|
module:'home_module'
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
const bannerList = res.data.data || []
|
||||||
|
this.bannerList = bannerList
|
||||||
|
// if (!bannerList.length) return
|
||||||
|
// const banner = bannerList[0]
|
||||||
|
// const EXPIRE_TIME = 2 * 60 * 60 * 1000
|
||||||
|
// const cache = uni.getStorageSync('banner')
|
||||||
|
// let useCache = false
|
||||||
|
// // 1️⃣ 缓存存在 + 未过期 + url 相同 → 用缓存
|
||||||
|
// if (
|
||||||
|
// cache &&
|
||||||
|
// cache.time &&
|
||||||
|
// Date.now() - cache.time < EXPIRE_TIME &&
|
||||||
|
// cache.data === banner.image_url
|
||||||
|
// ) {
|
||||||
|
// useCache = true
|
||||||
|
// this.bannerurl = uni.getStorageSync('bannerurl')
|
||||||
|
// }
|
||||||
|
// // 2️⃣ 否则更新缓存
|
||||||
|
// if (!useCache) {
|
||||||
|
// uni.setStorageSync('banner', {
|
||||||
|
// data: banner.image_url,
|
||||||
|
// time: Date.now()
|
||||||
|
// })
|
||||||
|
// uni.setStorageSync('bannerurl', banner.image_url_pull)
|
||||||
|
// this.bannerurl = banner.image_url_pull
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
reloadPage() {
|
||||||
|
this.$refs.paging.reload()
|
||||||
|
},
|
||||||
getFuzzy() {
|
getFuzzy() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wx.getSetting({
|
wx.getSetting({
|
||||||
@@ -122,17 +211,44 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
tabclick(item){
|
tabclick(item){
|
||||||
|
const that = this
|
||||||
|
if((this.longitude==''||this.latitude=='')&&item==1){
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请先授权地理位!',
|
||||||
|
content: '请在设置中开启模糊定位权限',
|
||||||
|
confirmText: '去设置',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.openSetting({
|
||||||
|
success: (setRes) => {
|
||||||
|
if (setRes.authSetting['scope.userFuzzyLocation']) {
|
||||||
|
that.getFuzzy().then(res => {
|
||||||
|
that.latitude = res.latitude
|
||||||
|
that.longitude = res.longitude
|
||||||
|
console.log(res);
|
||||||
|
}).catch(err => console.error(err));
|
||||||
|
} else {
|
||||||
|
reject(new Error('未开启模糊定位权限'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
this.activeTab = item;
|
this.activeTab = item;
|
||||||
this.$refs.paging && this.$refs.paging.reload()
|
this.$refs.paging && this.$refs.paging.reload()
|
||||||
},
|
},
|
||||||
//获取弹幕
|
//获取弹幕
|
||||||
barragelist(){
|
barragelist(){
|
||||||
request({
|
request({
|
||||||
url: 'admin/barrage/list',
|
url: 'common/barrage/all',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
this.danmuList = res.data.data.records
|
this.danmuList = res.data.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -234,7 +350,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
title: '西门子样机福利平台',
|
title: '西门子样机福利平台',
|
||||||
path: '/pages/index/index?from=share',
|
path: '/pages/index/index?from=share',
|
||||||
imageUrl: "/static/image/share.jpg" // 封面图
|
imageUrl: this.bannerList[0].image_url_pull // 封面图
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -247,29 +363,28 @@ export default {
|
|||||||
|
|
||||||
.header {
|
.header {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 720rpx;
|
|
||||||
}
|
}
|
||||||
.bg {
|
.banner-swiper{
|
||||||
|
width: 100%;
|
||||||
|
height: 430rpx;
|
||||||
|
}
|
||||||
|
.banner-img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-bottom-left-radius: 30rpx;
|
}
|
||||||
border-bottom-right-radius: 30rpx;
|
.homemap {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.homemap-img {
|
||||||
position: absolute;
|
width: 100%;
|
||||||
left: 40rpx;
|
display: block; /* 防止底部留白 */
|
||||||
top: 300rpx;
|
|
||||||
font-size: 68rpx;
|
|
||||||
line-height: 1.2;
|
|
||||||
color: #fff;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-btns {
|
.right-btns {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 40rpx;
|
right: 40rpx;
|
||||||
bottom: 100rpx;
|
top: 420rpx;
|
||||||
|
|
||||||
.circle-btn {
|
.circle-btn {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
@@ -298,7 +413,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.main-box {
|
.main-box {
|
||||||
margin: 20rpx 30rpx;
|
margin: 20rpx 30rpx;
|
||||||
margin-top: -60rpx;
|
// margin-top: -60rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
uploadfn(imgUrl){
|
uploadfn(imgUrl){
|
||||||
var that = this;
|
var that = this;
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: 'https://bsh.info.hb.hnzhwlkj.cn/upload/image?scene=userinfo',
|
url: 'https://bsh.info.yw.hnzhwlkj.cn/upload/image?scene=userinfo',
|
||||||
filePath: imgUrl,
|
filePath: imgUrl,
|
||||||
name: 'image',
|
name: 'image',
|
||||||
header:{'content-type': 'application/x-www-form-urlencoded','Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'wechat','Fdesk-System-Code':'wechat'},
|
header:{'content-type': 'application/x-www-form-urlencoded','Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'wechat','Fdesk-System-Code':'wechat'},
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<text>{{ formatContent(item.post && item.post.content) }}</text>
|
<text>{{ formatContent(item.post && item.post.content) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="msg-text1">
|
<view class="msg-text1">
|
||||||
<text>{{ item.comment.content }} </text>
|
<text>{{ item.comment.content?item.comment.content:'' }} </text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="publish-page">
|
<view class="publish-page">
|
||||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="样机发布"></uni-nav-bar>
|
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="样机发布"></uni-nav-bar>
|
||||||
<view class="form-card">
|
<view class="form-card">
|
||||||
<view class="select-input gradient-bg" @click="showSelect1 = true">
|
<view class="select-input gradient-bg" @click="onSelectCategory()">
|
||||||
<view class="category-content">
|
<view class="category-content">
|
||||||
<text class="category-text">{{form.category || '请输入/选择型号'}}</text>
|
<text class="category-text">{{form.category || '请输入/选择型号'}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="conts mag-top">
|
<view class="conts mag-top">
|
||||||
<view class="">
|
<view class="">
|
||||||
<textarea v-model="form.content" class="content-textarea" placeholder="请输入文字内容"
|
<textarea v-model="form.content" class="content-textarea" placeholder="例如:西门子 超氧 十字门冰箱,门店展示样机,位于郑州市商都路品牌店,展示年限不足1年外观全新、配件齐全;"
|
||||||
:maxlength="maxWords" @input="handleContentInput" />
|
:maxlength="maxWords" @input="handleContentInput" @focus="checkLogin()" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="media-upload-wrapper">
|
<view class="media-upload-wrapper">
|
||||||
<uni-file-picker fileMediatype="image" limit="9" @select="selectMedia" @delete="delfn" :imageStyles="imageStyles">
|
<uni-file-picker ref="mediaPicker" fileMediatype="image" limit="9" :disabled="!isLogin" @select="selectMedia" @delete="delfn" :imageStyles="imageStyles">
|
||||||
<view class="upload-icon-wrapper">
|
<view class="upload-icon-wrapper">
|
||||||
<image src="/static/image/photo.png" mode="" class="addimg"></image>
|
<image src="/static/image/photo.png" mode="" class="addimg"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,11 +23,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="help-text">
|
<view class="help-text">
|
||||||
<u-icon name="info-circle" size="18" color="#A6ABB7"></u-icon>
|
<u-icon name="info-circle" size="18" color="#A6ABB7"></u-icon>
|
||||||
<text>文字不多于2000字,图片不多于9张</text>
|
<text>请上传产品实物的正、侧、背多角度照片(禁止效果图),图片不多于9张</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mag-top">
|
<view class="mag-top">
|
||||||
<picker mode="selector" :range="conditionOptions" range-key="name" @change="onCategoryChange">
|
<picker mode="selector" :range="conditionOptions" range-key="name" :disabled="!isLogin" @tap="checkLogin()" @change="onCategoryChange">
|
||||||
<view class="select-input gradient-bg">
|
<view class="select-input gradient-bg">
|
||||||
<view class="category-content">
|
<view class="category-content">
|
||||||
<text class="category-text">{{form.agename || '请选择样机新旧程度'}}</text>
|
<text class="category-text">{{form.agename || '请选择样机新旧程度'}}</text>
|
||||||
@@ -37,9 +37,30 @@
|
|||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="mag-top">
|
<view class="mag-top">
|
||||||
<input class="uni-input" focus v-model="form.price" placeholder="请输入折扣价格" />
|
<input class="uni-input" focus v-model="form.price" @focus="checkLogin()" placeholder="请输入折扣价格" />
|
||||||
</view>
|
</view>
|
||||||
<view class="detils">
|
<view class="mag-top">
|
||||||
|
<view style="margin-bottom: 10rpx;">是否包邮:</view>
|
||||||
|
<uni-data-checkbox v-model="form.is_free" :localdata="freeshipping" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="detils" v-if="skudetils!=''">
|
||||||
|
<view class="product-card">
|
||||||
|
<view class="title">产品名称:{{skudetils.product_name}}</view>
|
||||||
|
<view class="price-row">
|
||||||
|
<text class="spec-label">零售价:</text>
|
||||||
|
<text class="spec-value">{{ skudetils.price }}</text>
|
||||||
|
<!-- <text class="model">产品型号:{{ skudetils.model }}</text> -->
|
||||||
|
</view>
|
||||||
|
<view class="spec-row">
|
||||||
|
<text class="spec-label">品牌:</text>
|
||||||
|
<text class="spec-value">{{ skudetils.brand }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="spec-row" v-for="(item, idx) in skudetils.spec_json" :key="idx">
|
||||||
|
<text class="spec-label">{{item.attr_name}}:</text>
|
||||||
|
<text class="spec-value">{{ item.attr_value }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<rich-text :nodes="productcontents"></rich-text>
|
<rich-text :nodes="productcontents"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -88,7 +109,7 @@
|
|||||||
<u-popup :show="showlogin" :closeOnClickOverlay="false" :round="20" mode="center">
|
<u-popup :show="showlogin" :closeOnClickOverlay="false" :round="20" mode="center">
|
||||||
<view class="popupcontent">
|
<view class="popupcontent">
|
||||||
<image class="log1" src="/static/image/log1.png"></image>
|
<image class="log1" src="/static/image/log1.png"></image>
|
||||||
<view class="title">{{$t('home.loginmsg')}}</view>
|
<view class="title">您还未登录!登录后方可发布内容!</view>
|
||||||
<view class="yhxy">
|
<view class="yhxy">
|
||||||
<checkbox-group name="" style="width: 28px;display: inline-block;">
|
<checkbox-group name="" style="width: 28px;display: inline-block;">
|
||||||
<label @tap="selfChangde()">
|
<label @tap="selfChangde()">
|
||||||
@@ -120,18 +141,28 @@ export default {
|
|||||||
showSelect2:false,
|
showSelect2:false,
|
||||||
searchKey1:'',
|
searchKey1:'',
|
||||||
productcontents:'',
|
productcontents:'',
|
||||||
|
skudetils:'',
|
||||||
|
// 单选数据源
|
||||||
|
freeshipping: [ {
|
||||||
|
text: '全国包邮',
|
||||||
|
value: 1
|
||||||
|
}, {
|
||||||
|
text: '省内包邮',
|
||||||
|
value: 2
|
||||||
|
}, {
|
||||||
|
text: '邮费电联',
|
||||||
|
value: 3
|
||||||
|
}],
|
||||||
categoryOptions:[],
|
categoryOptions:[],
|
||||||
conditionOptions:[
|
conditionOptions:[
|
||||||
{name:'全新',value:'10'},
|
{name:'全新(未开箱)',value:'10'},
|
||||||
{name:'9成新',value:'9'},
|
{name:'95%新(开箱无瑕)',value:'9'},
|
||||||
{name:'8成新',value:'8'},
|
{name:'90%新(外观轻损<2处)',value:'8'},
|
||||||
{name:'7成新',value:'7'},
|
{name:'85%新(外观轻损<3处)',value:'7'},
|
||||||
{name:'6成新',value:'6'},
|
{name:'75%新(外观轻损<5处)',value:'6'},
|
||||||
{name:'5成新',value:'5'},
|
{name:'70%新(外观轻损<6处)',value:'5'},
|
||||||
{name:'4成新',value:'4'},
|
{name:'60%新(外观轻损<7处)',value:'4'},
|
||||||
{name:'3成新',value:'3'},
|
{name:'不足60%新(外观损伤>7处)',value:'3'}
|
||||||
{name:'2成新',value:'2'},
|
|
||||||
{name:'1成新',value:'1'},
|
|
||||||
],
|
],
|
||||||
form:{
|
form:{
|
||||||
agename:'',
|
agename:'',
|
||||||
@@ -140,7 +171,8 @@ export default {
|
|||||||
sku_id:'',
|
sku_id:'',
|
||||||
content:'',
|
content:'',
|
||||||
media:[],
|
media:[],
|
||||||
price:''
|
price:'',
|
||||||
|
is_free:1
|
||||||
},
|
},
|
||||||
selfChecked: false,
|
selfChecked: false,
|
||||||
showlogin:false,
|
showlogin:false,
|
||||||
@@ -153,6 +185,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
|
isLogin() {
|
||||||
|
return !!uni.getStorageSync('is_login')
|
||||||
|
},
|
||||||
canSubmit(){
|
canSubmit(){
|
||||||
return this.agree && this.form.content.trim().length>0 && this.form.media.length>0
|
return this.agree && this.form.content.trim().length>0 && this.form.media.length>0
|
||||||
},
|
},
|
||||||
@@ -162,13 +197,30 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getcategory()
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
// this.getset()
|
// this.getset()
|
||||||
// this.syncTabbar()
|
// this.syncTabbar()
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
onSelectCategory() {
|
||||||
|
if (!uni.getStorageSync('is_login')) {
|
||||||
|
this.showlogin = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getcategory()
|
||||||
|
this.showSelect1 = true
|
||||||
|
},
|
||||||
|
checkLogin(cb) {
|
||||||
|
if (!this.isLogin) {
|
||||||
|
this.showlogin = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof cb === 'function') {
|
||||||
|
cb()
|
||||||
|
}
|
||||||
|
},
|
||||||
getlocation(){
|
getlocation(){
|
||||||
wx.getFuzzyLocation({
|
wx.getFuzzyLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
@@ -205,6 +257,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectCategory(item){
|
selectCategory(item){
|
||||||
|
this.skudetils = item
|
||||||
this.form.category = item.model || ''
|
this.form.category = item.model || ''
|
||||||
this.form.sku_id = item.id || ''
|
this.form.sku_id = item.id || ''
|
||||||
// 处理富文本,让图片自适应
|
// 处理富文本,让图片自适应
|
||||||
@@ -243,6 +296,7 @@ export default {
|
|||||||
phone_code: e.detail.code,
|
phone_code: e.detail.code,
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
if (res.data.code == -1) {
|
if (res.data.code == -1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.data.msg,
|
title: res.data.msg,
|
||||||
@@ -294,7 +348,7 @@ export default {
|
|||||||
uploadfn(imgUrl){
|
uploadfn(imgUrl){
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: 'https://cb.hnxinyouhe.com/upload/image?scene=postlist',
|
url: 'https://bsh.info.yw.hnzhwlkj.cn/upload/image?scene=postlist',
|
||||||
filePath: imgUrl,
|
filePath: imgUrl,
|
||||||
name: 'image',
|
name: 'image',
|
||||||
header:{'content-type': 'application/x-www-form-urlencoded','Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'wechat','Fdesk-System-Code':'wechat'},
|
header:{'content-type': 'application/x-www-form-urlencoded','Fdesk-Auth-Token': 'Bearer ' + uni.getStorageSync('token'),'Fdesk-Language': uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):'zh','Fdesk-Login-Type': 'wechat','Fdesk-System-Code':'wechat'},
|
||||||
@@ -359,6 +413,23 @@ export default {
|
|||||||
this.agree = true
|
this.agree = true
|
||||||
this.show = false
|
this.show = false
|
||||||
},
|
},
|
||||||
|
reset(){
|
||||||
|
this.form.agename='';
|
||||||
|
this.form.age='';
|
||||||
|
this.form.category='';
|
||||||
|
this.form.sku_id='';
|
||||||
|
this.form.content='';
|
||||||
|
this.form.media=[];
|
||||||
|
this.form.price='';
|
||||||
|
this.form.is_free=1;
|
||||||
|
this.productcontents=''
|
||||||
|
// 同步清理文件选择器内部的文件列表
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(this.$refs.mediaPicker && this.$refs.mediaPicker.clearFiles){
|
||||||
|
this.$refs.mediaPicker.clearFiles()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
submitForm(){
|
submitForm(){
|
||||||
// 必填校验
|
// 必填校验
|
||||||
if(!this.form.category || !this.form.sku_id){
|
if(!this.form.category || !this.form.sku_id){
|
||||||
@@ -413,10 +484,12 @@ export default {
|
|||||||
title: res.data.message,
|
title: res.data.message,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
|
|
||||||
if(res.data.code ==200){
|
if(res.data.code ==200){
|
||||||
|
this.reset()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.navigateTo({
|
||||||
url: '/pages/square/index',// 替换为你要跳转的页面路径
|
url: '/pages/mine/my_favorites',// 替换为你要跳转的页面路径
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@@ -563,6 +636,11 @@ export default {
|
|||||||
.mag-top{
|
.mag-top{
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
.free{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
.content-textarea{
|
.content-textarea{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// background: #F7F8FB;
|
// background: #F7F8FB;
|
||||||
@@ -638,8 +716,9 @@ export default {
|
|||||||
.foot{
|
.foot{
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 1rpx;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 11;
|
||||||
}
|
}
|
||||||
.agreement{
|
.agreement{
|
||||||
margin: 20px 12px;
|
margin: 20px 12px;
|
||||||
@@ -790,4 +869,51 @@ export default {
|
|||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.product-card {
|
||||||
|
background: #fff;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
padding: 24rpx 24rpx 12rpx;
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #111;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.price-row {
|
||||||
|
margin-top: 12rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
.price {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #111;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.retail {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.model {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
.spec-row {
|
||||||
|
margin-top: 18rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #555;
|
||||||
|
gap: 6rpx;
|
||||||
|
}
|
||||||
|
.spec-label {
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
.spec-value {
|
||||||
|
color: #444;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<scroll-view scroll-y class="page-scroll">
|
<scroll-view scroll-y class="page-scroll">
|
||||||
<!-- 图集 -->
|
<!-- 图集 -->
|
||||||
<view class="gallery">
|
<view class="gallery">
|
||||||
<image v-if="detail.media && detail.media.length > 0" class="main-img" :src="detail.media[currentIndex].url_pull" mode="aspectFit"></image>
|
<image v-if="detail.media && detail.media.length > 0" class="main-img" @click.stop="previewImage(currentIndex)"
|
||||||
|
@longpress.stop="downloadImage(detail.media[currentIndex])" :src="detail.media[currentIndex].url_pull" mode="aspectFit"></image>
|
||||||
<scroll-view class="thumb-row" scroll-x>
|
<scroll-view class="thumb-row" scroll-x>
|
||||||
<view class="thumb-container">
|
<view class="thumb-container">
|
||||||
<image
|
<image
|
||||||
@@ -40,7 +41,18 @@
|
|||||||
<text class="spec-label">{{item.attr_name}}:</text>
|
<text class="spec-label">{{item.attr_name}}:</text>
|
||||||
<text class="spec-value">{{ item.attr_value }}</text>
|
<text class="spec-value">{{ item.attr_value }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="spec-row">
|
||||||
|
<text class="spec-label">是否包邮:</text>
|
||||||
|
<text class="spec-value">{{ detail.is_free==0?'不包邮':detail.is_free==1?'全国包邮':detail.is_free==2?'省内包邮':'邮费电联' }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="product-card" v-if="detail.sku.point">
|
||||||
|
<view class="product-point-title"> 产品卖点 </view>
|
||||||
|
<view class="point-tabs" >
|
||||||
|
<view class="tabs-txt" v-for="(item, idx) in detail.sku.point.attr_values" :key="idx">{{item}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- Tabs -->
|
<!-- Tabs -->
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
@@ -101,7 +113,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="bottom-bar">
|
<view class="bottom-bar" v-if="currentTab === 'comment'">
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<uni-icons type="compose" size="20" color="#bbb"></uni-icons>
|
<uni-icons type="compose" size="20" color="#bbb"></uni-icons>
|
||||||
<input class="input"
|
<input class="input"
|
||||||
@@ -701,6 +713,7 @@ page,
|
|||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.thumb-container {
|
.thumb-container {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@@ -741,6 +754,20 @@ page,
|
|||||||
color: #111;
|
color: #111;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
.product-point-title{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.point-tabs{
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
.tabs-txt{
|
||||||
|
padding: 20rpx;
|
||||||
|
color: #3BC6BD;
|
||||||
|
background:rgb(59 198 189 / 0.12);
|
||||||
|
display: inline-block;
|
||||||
|
margin: 6px 5px;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
.retail {
|
.retail {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #888;
|
color: #888;
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ export default {
|
|||||||
// this.syncTabbar()
|
// this.syncTabbar()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
goto(item){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/square/detiles?id='+item.id
|
||||||
|
});
|
||||||
|
},
|
||||||
getFuzzy() {
|
getFuzzy() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wx.getSetting({
|
wx.getSetting({
|
||||||
@@ -114,12 +119,38 @@ export default {
|
|||||||
uni.makePhoneCall({ phoneNumber: num });
|
uni.makePhoneCall({ phoneNumber: num });
|
||||||
},
|
},
|
||||||
changeTab(key) {
|
changeTab(key) {
|
||||||
if (this.currentTab === key) return
|
if((this.longitude==''||this.latitude=='')&&key=='near'){
|
||||||
this.currentTab = key
|
uni.showModal({
|
||||||
this.page = 1
|
title: '提示',
|
||||||
this.hasMore = true
|
content: '请先授权地理位!',
|
||||||
this.slist = []
|
content: '请在设置中开启模糊定位权限',
|
||||||
this.loadList()
|
confirmText: '去设置',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
wx.openSetting({
|
||||||
|
success: (setRes) => {
|
||||||
|
if (setRes.authSetting['scope.userFuzzyLocation']) {
|
||||||
|
that.getFuzzy().then(res => {
|
||||||
|
that.latitude = res.latitude
|
||||||
|
that.longitude = res.longitude
|
||||||
|
console.log(res);
|
||||||
|
}).catch(err => console.error(err));
|
||||||
|
} else {
|
||||||
|
reject(new Error('未开启模糊定位权限'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this.currentTab === key) return
|
||||||
|
this.currentTab = key
|
||||||
|
this.page = 1
|
||||||
|
this.hasMore = true
|
||||||
|
this.slist = []
|
||||||
|
this.loadList()
|
||||||
},
|
},
|
||||||
loadList(isLoadMore = false) {
|
loadList(isLoadMore = false) {
|
||||||
if (isLoadMore) {
|
if (isLoadMore) {
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 588 B |
|
Before Width: | Height: | Size: 853 B |