解决后端更新之后es中与前端不匹配bug,优化部分代码复用性

master
lemon橪 2021-09-02 16:08:35 +08:00
parent 275d76c0dd
commit 6ca01d2c71
15 changed files with 88 additions and 73 deletions

View File

@ -4,16 +4,16 @@
<div class="goods-list"> <div class="goods-list">
<div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index"> <div @click="handleClick(item)" class="goods-item" v-for="(item, item_index) in goodsList" :key="item_index">
<div class="goods-img"> <div class="goods-img">
<u-image :src="item.thumbnail" mode="aspectFill" height="350rpx" width="100%"> <u-image :src="item.content.thumbnail" mode="aspectFill" height="350rpx" width="100%">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
</div> </div>
<div class="goods-desc"> <div class="goods-desc">
<div class="goods-title"> <div class="goods-title">
{{ item.goodsName }} {{ item.content.goodsName }}
</div> </div>
<div class="goods-bottom"> <div class="goods-bottom">
<div class="goods-price">{{ item.price | unitPrice }}</div> <div class="goods-price">{{ item.content.price | unitPrice }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -73,13 +73,12 @@ export default {
delete submit[key]; delete submit[key];
} }
}); });
let goodsList = await getGoodsList(submit); let goodsList = await getGoodsList(submit);
this.goodsList.push(...goodsList.data.result.content); this.goodsList.push(...goodsList.data.result.content);
}, },
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`, url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
}); });
}, },
}, },

View File

@ -1,7 +1,8 @@
const name = "lilishop"; const name = "lilishop"; //全局商城name
const schemeName = 'lilishop' //唤醒app需要的schemeName
export default { export default {
name: name, name: name,
schemeLink: `${name}://`, //唤起app地址 schemeLink: `${schemeName}://`, //唤起app地址
downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址 downloadLink: "https://pickmall.cn/download-page/index.html", //下载地址下载app的地址
shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址 shareLink: "https://m-b2b2c.pickmall.cn", //分享地址也就是在h5中默认的复制地址
appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态) appid: "wx6f10f29075dc1b0b", //小程序唯一凭证,即 AppID可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态)

View File

@ -85,16 +85,16 @@
<div class="goodsClass"> <div class="goodsClass">
<u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow"> <u-row v-for="(item, index) in goodsList" :key="index" class="goodsRow">
<u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1"> <u-col :span="4" @click.native="navigateToDetailPage(item)" class="switchType1">
<u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.thumbnail"> <u-image width="182rpx" height="200rpx" class="imgGoods" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
</u-col> </u-col>
<u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2"> <u-col :span="8" @click.native="navigateToDetailPage(item)" class="switchType2">
<div class="title clamp3" style="">{{ item.goodsName }}</div> <div class="title clamp3" style="">{{ item.content.goodsName }}</div>
<view class="price-box"> <view class="price-box">
<div class="price" v-if="item.price!=undefined"> <div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{ ¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.price )[1] formatPrice(item.content.price )[1]
}} }}
</div> </div>
</view> </view>
@ -156,15 +156,15 @@
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" <view v-for="(item, index) in goodsList" :key="index" class="goods-item"
@click="navigateToDetailPage(item)"> @click="navigateToDetailPage(item)">
<view class="image-wrapper"> <view class="image-wrapper">
<image :src="item.thumbnail" mode="aspectFill"></image> <image :src="item.content.thumbnail" mode="aspectFill"></image>
</view> </view>
<view class="goods-detail"> <view class="goods-detail">
<div class="title clamp">{{ item.goodsName }}</div> <div class="title clamp">{{ item.content.goodsName }}</div>
<view class="price-box"> <view class="price-box">
<div class="price" v-if="item.price!=undefined"> <div class="price" v-if="item.content.price!=undefined">
¥<span>{{ formatPrice(item.price )[0] }} </span>.{{ ¥<span>{{ formatPrice(item.content.price )[0] }} </span>.{{
formatPrice(item.price )[1] formatPrice(item.content.price )[1]
}} }}
</div> </div>
</view> </view>
@ -538,7 +538,7 @@ export default {
}, },
navigateToDetailPage(item) { navigateToDetailPage(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${item.id}&goodsId=${item.goodsId}`, url: `/pages/product/goods?id=${item.content.id}&goodsId=${item.content.goodsId}`,
}); });
}, },
loadmore() { loadmore() {
@ -669,7 +669,7 @@ export default {
if (type == "refresh") { if (type == "refresh") {
this.goodsList = []; this.goodsList = [];
} }
// // #TODO
let goodsList = await getGoodsList(this.params); let goodsList = await getGoodsList(this.params);
if (goodsList.data.result.content.length < 10) { if (goodsList.data.result.content.length < 10) {

View File

@ -790,7 +790,7 @@ page {
.wrapper { .wrapper {
height: auto; height: auto;
background: #ededed; background: #f7f7f7;
padding-bottom: 200rpx; padding-bottom: 200rpx;
overflow: auto !important; overflow: auto !important;
} }

View File

@ -48,10 +48,10 @@ span {
border-radius: 100px; border-radius: 100px;
} }
.logo { .logo {
margin-top: 20rpx;
width: 200rpx; width: 200rpx;
height: 200rpx; height: 200rpx;
text-align: center; text-align: center;
transform: scale(2.5);
} }
.logo-cell { .logo-cell {
text-align: center; text-align: center;

View File

@ -4,9 +4,9 @@
<view class="login-ball bg-linear-gradient small"></view> <view class="login-ball bg-linear-gradient small"></view>
<view class="logo-cell"> <view class="logo-cell">
<image class="logo" src="/static/logo.png" mode="aspectFit"></image> <image class="logo" :src="config.logo" mode="aspectFit"></image>
</view> </view>
<view class="title">LiLi商城</view> <view class="title">{{config.name}}</view>
<!-- 验证码登录 --> <!-- 验证码登录 -->
<codeLogin @open="open" :status="value" v-if="login && loginData.code" /> <codeLogin @open="open" :status="value" v-if="login && loginData.code" />
@ -31,8 +31,8 @@ import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import { loginCallback } from "@/api/connect.js"; import { loginCallback } from "@/api/connect.js";
import { webConnect } from "@/api/connect.js"; import { webConnect } from "@/api/connect.js";
import config from "@/config/config";
export default { export default {
onShow() { onShow() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.mpWechatLogin = false; this.mpWechatLogin = false;
@ -65,6 +65,7 @@ export default {
}, },
data() { data() {
return { return {
config,
lightColor: this.$lightColor, lightColor: this.$lightColor,
mpWechatLogin: true, // mpWechatLogin: true, //
value: true, // value: true, //
@ -102,7 +103,6 @@ export default {
// //
stateLogin(state) { stateLogin(state) {
loginCallback(state).then((res) => { loginCallback(state).then((res) => {
let data = res.data; let data = res.data;
if (data.success) { if (data.success) {
storage.setAccessToken(data.result.accessToken); storage.setAccessToken(data.result.accessToken);

View File

@ -12,7 +12,7 @@
<view class="wx-auth-container"> <view class="wx-auth-container">
<div class="box"> <div class="box">
<view class="logo-info"> <view class="logo-info">
<text class="title">欢迎进入{{ projectName }}商城</text> <text class="title">欢迎进入{{ projectName }}</text>
</view> </view>
<view class="small-tips"> <view class="small-tips">
<view>为您提供优质服务,{{ projectName }}需要获取以下信息</view> <view>为您提供优质服务,{{ projectName }}需要获取以下信息</view>
@ -33,13 +33,14 @@ import { mpAutoLogin } from "@/api/connect.js";
import { whetherNavigate } from "@/utils/Foundation"; // import { whetherNavigate } from "@/utils/Foundation"; //
import { getUserInfo } from "@/api/members"; import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import config from '@/config/config'
export default { export default {
data() { data() {
return { return {
// //
phoneAuthPopup: false, phoneAuthPopup: false,
// //
projectName: "LiLi", projectName: config.name,
//sessionkey //sessionkey
code: "", code: "",
// //

View File

@ -7,9 +7,11 @@
<!-- 仅h5有效 打开App --> <!-- 仅h5有效 打开App -->
<!-- 分享 --> <!-- 分享 -->
<shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId" <shares v-if="shareFlage && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId"
:link="'/pages/product/goods?id='+this.routerVal.id+'&goodsId='+this.routerVal.goodsId"
:thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" /> :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="shareFlage = false" />
<popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX" :y="navbarListY" placement="top-start" /> <popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
:y="navbarListY" placement="top-start" />
<view class="index"> <view class="index">
<!-- topBar --> <!-- topBar -->
@ -22,7 +24,8 @@
</div> </div>
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'"> <div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
<div class="headerRow"> <div class="headerRow">
<div class="nav-item" v-for="header in headerList" :key="header.id" :class="{ cur: scrollId === header.id }" @click="headerTab(header.id)"> <div class="nav-item" v-for="header in headerList" :key="header.id"
:class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
{{ header.text }} {{ header.text }}
</div> </div>
</div> </div>
@ -30,7 +33,8 @@
</div> </div>
</u-navbar> </u-navbar>
<u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack" :is-back="false"> <u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
:is-back="false">
<div> <div>
<div class="bg-back"> <div class="bg-back">
<u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon> <u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
@ -42,7 +46,8 @@
</view> </view>
<view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef"> <view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
<scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page" :scroll-top="tabScrollTop" @scroll="pageScroll"> <scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
:scroll-top="tabScrollTop" @scroll="pageScroll">
<view> <view>
<!-- 轮播图 --> <!-- 轮播图 -->
<GoodsSwiper id="main1" :res="imgList" /> <GoodsSwiper id="main1" :res="imgList" />
@ -58,7 +63,8 @@
{{ goodsDetail.goodsName || "" }} {{ goodsDetail.goodsName || "" }}
</view> </view>
<view class="favorite" @click="clickFavorite(goodsDetail.id)"> <view class="favorite" @click="clickFavorite(goodsDetail.id)">
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon> <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
</u-icon>
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view> <view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
</view> </view>
</view> </view>
@ -88,7 +94,8 @@
<view>分享</view> <view>分享</view>
</view> </view>
<view class="icons" @click="clickFavorite(goodsDetail.id)"> <view class="icons" @click="clickFavorite(goodsDetail.id)">
<u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'"></u-icon> <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
:name="favorite ? 'heart-fill' : 'heart'"></u-icon>
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view> <view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ favorite ? "已收藏" : "收藏" }}</view>
</view> </view>
</view> </view>
@ -153,7 +160,8 @@
<storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" /> <storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
<!-- 宝贝详情 --> <!-- 宝贝详情 -->
<GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId" v-if="goodsDetail.id" /> <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
v-if="goodsDetail.id" />
<!-- 宝贝推荐 --> <!-- 宝贝推荐 -->
<GoodsRecommend id="main11" :res="likeGoodsList" /> <GoodsRecommend id="main11" :res="likeGoodsList" />
@ -178,7 +186,8 @@
</view> </view>
<!-- 正常结算页面 --> <!-- 正常结算页面 -->
<view class="detail-btn" v-if="!isGroup"> <view class="detail-btn" v-if="!isGroup">
<view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)"></view> <view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType!='VIRTUAL_GOODS'" @click="shutMask(4)">
加入购物车</view>
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view> <view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
<view class="to-store-car to-store-btn" v-if="startTimer"></view> <view class="to-store-car to-store-btn" v-if="startTimer"></view>
</view> </view>
@ -215,10 +224,12 @@
</view> </view>
<!-- 配送地址弹窗 --> <!-- 配送地址弹窗 -->
<popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id" :goodsId="goodsDetail.id" :addressFlag="addressFlag" /> <popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
:goodsId="goodsDetail.id" :addressFlag="addressFlag" />
<!-- 商品规格 商品详情以及默认参与活动的id--> <!-- 商品规格 商品详情以及默认参与活动的id-->
<popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy" @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId" <popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
@queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :id="productId"
v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" /> v-if="goodsDetail.id " :pointDetail="pointDetail" @handleClickSku="selectSku" :buyMask="buyMask" />
</view> </view>
</view> </view>
@ -510,11 +521,11 @@ export default {
this.productId = id; // skuId this.productId = id; // skuId
// //
let response = await getGoods(id, goodsId); let response = await getGoods(id, goodsId);
if (!response.data.success) { if (!response.data.success) {
setTimeout(()=>{
uni.navigateBack(); uni.navigateBack();
return false; },500)
} }
// //
if (distributionId || this.$store.state.distributionId) { if (distributionId || this.$store.state.distributionId) {
@ -719,6 +730,7 @@ export default {
/** /**
* 获取相似商品列表 * 获取相似商品列表
*
*/ */
getOtherLikeGoods() { getOtherLikeGoods() {
getGoodsList({ getGoodsList({
@ -728,7 +740,6 @@ export default {
keyword: this.goodsDetail.name, keyword: this.goodsDetail.name,
}).then((res) => { }).then((res) => {
this.likeGoodsList = res.data.result.content; this.likeGoodsList = res.data.result.content;
console.warn(this.likeGoodsList);
}); });
}, },

View File

@ -13,7 +13,7 @@
:fade="true" :fade="true"
duration="450" duration="450"
:lazy-load="true" :lazy-load="true"
:src="item.thumbnail" :src="item.content.thumbnail"
width="330rpx" width="330rpx"
height="330rpx" height="330rpx"
class="like-goods-uimage" class="like-goods-uimage"
@ -21,12 +21,12 @@
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<view style="background-color: #ffffff; width: 100%"> <view style="background-color: #ffffff; width: 100%">
<view class="name">{{ item.goodsName }}</view> <view class="name">{{ item.content.goodsName }}</view>
<view class="price-sales"> <view class="price-sales">
<div class="item-price" v-if="item.price != undefined"> <div class="item-price" v-if="item.content.price != undefined">
<span>{{ formatPrice(item.price)[0] }}</span> <span>{{ formatPrice(item.content.price)[0] }}</span>
.{{formatPrice(item.price)[1]}} .{{formatPrice(item.content.price)[1]}}
<!-- <text v-if="item.point != undefined">+{{ item.point }}</text> --> <!-- <text v-if="item.point != undefined">+{{ item.point }}</text> -->
</div> </div>
</view> </view>
@ -44,7 +44,7 @@ export default {
// //
clickGoods(val) { clickGoods(val) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}` url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`
}); });
}, },
// 1999 --> [1999,00] // 1999 --> [1999,00]

View File

@ -63,7 +63,7 @@
<!-- 数量 --> <!-- 数量 -->
<view class="goods-skus-number"> <view class="goods-skus-number">
<view class="view-class-title">数量</view> <view class="view-class-title">数量</view>
<u-number-box :bg-color="numberBox.bgColor" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num"> <u-number-box :bg-color="numberBox.bgColor" :max="200" :color="numberBox.color" :input-width="numberBox.width" :input-height="numberBox.height" :size="numberBox.size" :min="1" v-model="num">
</u-number-box> </u-number-box>
</view> </view>
</view> </view>

View File

@ -24,15 +24,15 @@
<view class="store-recommend-title">商品推荐</view> <view class="store-recommend-title">商品推荐</view>
<view class="recommend-list"> <view class="recommend-list">
<view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index"> <view class="recommend-item" @click="clickGoods(item)" v-for="(item, index) in res" :key="index">
<u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.thumbnail" height="218rpx"> <u-image class="recommend-item-img" :fade="true" duration="450" :lazy-load="true" :src="item.content.thumbnail" height="218rpx">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx; ">加载失败</view> <view slot="error" style="font-size: 24rpx; ">加载失败</view>
</u-image> </u-image>
<view class="recommend-item-name"> <view class="recommend-item-name">
{{ item.goodsName }} {{ item.content.goodsName }}
</view> </view>
<view class="item-price" v-if="item.price != undefined"> <view class="item-price" v-if="item.price != undefined">
<span class="item-price-blod">{{ formatPrice(item.price)[0] }}</span>.{{ formatPrice(item.price)[1] }} <span class="item-price-blod">{{ formatPrice(item.content.price)[0] }}</span>.{{ formatPrice(item.content.price)[1] }}
</view> </view>
</view> </view>
</view> </view>
@ -58,7 +58,7 @@ export default {
// //
clickGoods(val) { clickGoods(val) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`, url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
}); });
}, },

View File

@ -6,7 +6,7 @@
<div class="wrapper"> <div class="wrapper">
<!-- 店铺信息模块 --> <!-- 店铺信息模块 -->
<div class="store flex"> <div class="store flex">
<u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || '/static/logo.png'" mode="aspectFit"></u-image> <u-image border-radius="10" width="150" height="150" :src="storeInfo.storeLogo || config.logo" mode="aspectFit"></u-image>
<div class="box"> <div class="box">
<div class="store-name" @click="getStoreLicencePhoto"> <div class="store-name" @click="getStoreLicencePhoto">
{{ storeInfo.storeName || ''}} {{ storeInfo.storeName || ''}}
@ -60,15 +60,15 @@
<div class="contant" v-if="current == 0"> <div class="contant" v-if="current == 0">
<view v-if="!goodsList.length" class="empty"></view> <view v-if="!goodsList.length" class="empty"></view>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
<u-image width="100%" height="330rpx" mode="aspectFit" :src="item.thumbnail"> <u-image width="100%" height="330rpx" mode="aspectFit" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<div class="name">{{ item.goodsName }}</div> <div class="name">{{ item.content.goodsName }}</div>
<div class="price"> <div class="price">
<div>{{ item.price | unitPrice }}</div> <div>{{ item.content.price | unitPrice }}</div>
</div> </div>
<view class="buyCount"> <view class="buyCount">
<div>已售 {{ item.buyCount || "0" }}</div> <div>已售 {{ item.content.buyCount || "0" }}</div>
</view> </view>
</view> </view>
</div> </div>
@ -99,13 +99,14 @@ import {
collectionGoods, collectionGoods,
getGoodsIsCollect, getGoodsIsCollect,
} from "@/api/members.js"; } from "@/api/members.js";
import config from '@/config/config'
import storage from "@/utils/storage"; import storage from "@/utils/storage";
import { getGoodsList } from "@/api/goods.js"; import { getGoodsList } from "@/api/goods.js";
import { getAllCoupons } from "@/api/promotions.js"; import { getAllCoupons } from "@/api/promotions.js";
export default { export default {
data() { data() {
return { return {
config,
scrollTop: 0, scrollTop: 0,
mainColor: this.$mainColor, // mainColor: this.$mainColor, //
current: 0, //tabs current: 0, //tabs
@ -278,7 +279,7 @@ export default {
*/ */
navigateToGoodsDetail(val) { navigateToGoodsDetail(val) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`, url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
}); });
}, },

View File

@ -5,12 +5,12 @@
<div class="contant"> <div class="contant">
<view v-if="!goodsList.length" class="empty"></view> <view v-if="!goodsList.length" class="empty"></view>
<view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)"> <view v-else class="item" v-for="(item,index) in goodsList" :key="index" @click="navigateToGoodsDetail(item)">
<u-image width="100%" mode="aspectFit" height="324rpx" :src="item.thumbnail"> <u-image width="100%" mode="aspectFit" height="324rpx" :src="item.content.thumbnail">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
</u-image> </u-image>
<div class="name">{{ item.goodsName }}</div> <div class="name">{{ item.content.goodsName }}</div>
<div class="price"> <div class="price">
<div>{{ item.price | unitPrice }}</div> <div>{{ item.content.price | unitPrice }}</div>
</div> </div>
<view class="buyCount"> <view class="buyCount">
<div>已售 {{ item.buyCount || "0" }}</div> <div>已售 {{ item.buyCount || "0" }}</div>
@ -61,11 +61,12 @@ export default {
*/ */
navigateToGoodsDetail(val) { navigateToGoodsDetail(val) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/goods?id=${val.id}&goodsId=${val.goodsId}`, url: `/pages/product/goods?id=${val.content.id}&goodsId=${val.content.goodsId}`,
}); });
}, },
async getGoodsData() { async getGoodsData() {
// #TODO
let goodsList = await getGoodsList(this.params); let goodsList = await getGoodsList(this.params);
if (goodsList.data.success) { if (goodsList.data.success) {
this.goodsList.push(...goodsList.data.result.content); this.goodsList.push(...goodsList.data.result.content);

View File

@ -124,6 +124,7 @@ import {
helpBargain, helpBargain,
} from "@/api/promotions"; } from "@/api/promotions";
import shares from "@/components/m-share/index"; import shares from "@/components/m-share/index";
import config from "@/config/config";
export default { export default {
components: { components: {
shares, shares,
@ -178,7 +179,7 @@ export default {
return { return {
path: this.share(), path: this.share(),
title: `请快来帮我砍一刀${this.bargainDetail.goodsName}`, title: `请快来帮我砍一刀${this.bargainDetail.goodsName}`,
imageUrl: this.thumbnail || require("@/static/logo.png"), imageUrl: this.thumbnail || config.logo,
}; };
}, },
// #endif // #endif

View File

@ -13,17 +13,17 @@
<view class="scroll-con"> <view class="scroll-con">
<view v-if="nomsg"></view> <view v-if="nomsg"></view>
<view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)"> <view v-else class="con" v-for="(item,index) in goodsList" :key="index" @click="goDetail(item)">
<image :src="item.thumbnail" mode=""></image> <image :src="item.content.thumbnail" mode=""></image>
<view class="nowrap">{{item.name}}</view> <view class="nowrap">{{item.content.name}}</view>
<view> <view>
<text>{{item.price | unitPrice}} <text>{{item.content.price | unitPrice}}
<!-- <text v-if="item.point">+{{item.point || 0}}</text> --> <!-- <text v-if="item.point">+{{item.point || 0}}</text> -->
</text> </text>
<text>{{item.mktprice}}</text> <text>{{item.content.mktprice}}</text>
</view> </view>
<view> <view>
<text>已售{{item.buy_count}}</text> <text>已售{{item.content.buy_count}}</text>
<text>{{item.grade}}%好评</text> <text>{{item.content.grade}}%好评</text>
</view> </view>
</view> </view>
</view> </view>
@ -74,7 +74,7 @@
}, },
goDetail(item) { goDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/product/goods?id=' + item.id + "&goodsId=" +item.goodsId url: '/pages/product/goods?id=' + item.content.id + "&goodsId=" +item.content.goodsId
}) })
}, },
loadData() { loadData() {