Merge branch 'master' of https://gitee.com/anhaogxs/yshopmall_uni
This commit is contained in:
@ -35,6 +35,14 @@ export function getProducts(q) {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
/*
|
||||
* 积分商品列表
|
||||
* */
|
||||
export function getProductsIntegral(q) {
|
||||
return request.get("/products/integral", q, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车数量
|
||||
|
@ -1,7 +1,8 @@
|
||||
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
|
||||
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';
|
||||
|
@ -2,9 +2,7 @@
|
||||
<view :class="productConClass">
|
||||
<view v-if="storeInfo.id">
|
||||
<!-- 轮播图 -->
|
||||
<product-con-swiper
|
||||
:img-urls="storeInfo.sliderImageArr"
|
||||
></product-con-swiper>
|
||||
<product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper>
|
||||
|
||||
<!-- 商品信息描述 -->
|
||||
<view class="wrapper">
|
||||
@ -14,21 +12,11 @@
|
||||
<text class="num">{{
|
||||
attr.productSelect.price || storeInfo.price
|
||||
}}</text>
|
||||
<text
|
||||
class="vip-money"
|
||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
|
||||
>¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text
|
||||
>
|
||||
<image
|
||||
src="@/static/images/vip.png"
|
||||
class="image"
|
||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
|
||||
/>
|
||||
<text class="vip-money"
|
||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ attr.productSelect.vipPrice || storeInfo.vipPrice }}</text>
|
||||
<image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
||||
</view>
|
||||
<view
|
||||
class="iconfont icon-fenxiang"
|
||||
@click="listenerActionSheet"
|
||||
></view>
|
||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
||||
</view>
|
||||
<view class="introduce">{{ storeInfo.storeName }}</view>
|
||||
<view class="label acea-row row-between-wrapper">
|
||||
@ -36,19 +24,11 @@
|
||||
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
|
||||
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="coupon acea-row row-between-wrapper"
|
||||
@click="couponTap"
|
||||
v-if="couponList.length"
|
||||
>
|
||||
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
|
||||
<text class="hide line1">
|
||||
<text>优惠券:</text>
|
||||
<text
|
||||
class="activity"
|
||||
v-for="(item, couponListEq) in couponList"
|
||||
:key="couponListEq"
|
||||
>满{{ item.useMinPrice }}减{{ item.couponPrice }}</text
|
||||
>
|
||||
<text class="activity" v-for="(item, couponListEq) in couponList"
|
||||
:key="couponListEq">满{{ item.useMinPrice }}减{{ item.couponPrice }}</text>
|
||||
</text>
|
||||
<view class="iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
@ -63,10 +43,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 规格 -->
|
||||
<view
|
||||
class="attribute acea-row row-between-wrapper"
|
||||
@click="selecAttrTap"
|
||||
>
|
||||
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
|
||||
<view>
|
||||
<text>{{ attrTxt }}:</text>
|
||||
<text class="atterTxt">{{ attrValue }}</text>
|
||||
@ -90,22 +67,14 @@
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="name line1">{{ systemStore.name }}</view>
|
||||
<view
|
||||
class="address acea-row row-middle"
|
||||
@click="showChang(systemStore)"
|
||||
>
|
||||
<view class="address acea-row row-middle" @click="showChang(systemStore)">
|
||||
<text class="addressTxt">{{ systemStore.address }}</text>
|
||||
<text class="iconfont icon-youjian"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addressBox">
|
||||
<a
|
||||
class="iconfont icon-dadianhua01 font-color-red phone"
|
||||
@click="telPhone(systemStore.phone)"
|
||||
></a>
|
||||
<view class="addressTxt corlor-yshop"
|
||||
>距离{{ systemStore.distance }}千米</view
|
||||
>
|
||||
<a class="iconfont icon-dadianhua01 font-color-red phone" @click="telPhone(systemStore.phone)"></a>
|
||||
<view class="addressTxt corlor-yshop">距离{{ systemStore.distance }}千米</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -181,11 +150,7 @@
|
||||
<view class="iconfont icon-shoucang"></view>
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
<view
|
||||
@click="goShoppingCart()"
|
||||
v-if="animated"
|
||||
class="item animated bounceIn"
|
||||
>
|
||||
<view @click="goShoppingCart()" v-if="animated" class="item animated bounceIn">
|
||||
<view class="iconfont icon-gouwuche1">
|
||||
<text class="num bg-color-red" v-if="CartCount > 0">{{
|
||||
CartCount
|
||||
@ -214,23 +179,12 @@
|
||||
<!-- 优惠券 -->
|
||||
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
|
||||
<!-- 商品规格弹窗 -->
|
||||
<ProductWindow
|
||||
v-on:changeFun="changeFun"
|
||||
:attr="attr"
|
||||
:cartNum="cart_num"
|
||||
></ProductWindow>
|
||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
|
||||
<!-- 分享海报 -->
|
||||
<StorePoster
|
||||
v-on:setPosterImageStatus="setPosterImageStatus"
|
||||
:posterImageStatus="posterImageStatus"
|
||||
:posterData="posterData"
|
||||
:goodId="id"
|
||||
></StorePoster>
|
||||
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
|
||||
:posterData="posterData" :goodId="id"></StorePoster>
|
||||
<!-- 分享弹窗 -->
|
||||
<ShareInfo
|
||||
v-on:setShareInfoStatus="setShareInfoStatus"
|
||||
:shareInfoStatus="shareInfoStatus"
|
||||
></ShareInfo>
|
||||
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
||||
|
||||
<view class="generate-posters acea-row row-middle on" v-if="posters">
|
||||
<view class="item" @click="setPosterImageStatus">
|
||||
@ -244,12 +198,7 @@
|
||||
<view>生成海报</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="mask"
|
||||
@touchmove.prevent
|
||||
@click="listenerActionClose"
|
||||
v-show="posters"
|
||||
></view>
|
||||
<view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view>
|
||||
<view class="posterCanvasWarp">
|
||||
<canvas class="posterCanvas" canvas-id="myCanvas"></canvas>
|
||||
</view>
|
||||
@ -286,9 +235,15 @@ import {
|
||||
handleUrlParam,
|
||||
getCurrentPageUrlWithArgs,
|
||||
} from "@/utils";
|
||||
import { wechatEvevt } from "@/libs/wechat";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
wechatEvevt
|
||||
} from "@/libs/wechat";
|
||||
import {
|
||||
imageBase64
|
||||
} from "@/api/public";
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "GoodsCon",
|
||||
@ -356,6 +311,7 @@ export default {
|
||||
qqmapsdk: null,
|
||||
productConClass: "product-con",
|
||||
tempName: "全国包邮",
|
||||
isIntegral: "false"
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["isLogin", "location"]),
|
||||
@ -393,8 +349,7 @@ export default {
|
||||
return {
|
||||
title: this.storeInfo.storeName,
|
||||
imageUrl: this.storeInfo.image,
|
||||
path:
|
||||
"pages/shop/GoodsCon/index?id=" +
|
||||
path: "pages/shop/GoodsCon/index?id=" +
|
||||
this.storeInfo.id +
|
||||
"&spread=" +
|
||||
uni.getStorageSync("uid") +
|
||||
@ -523,8 +478,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
uni.showToast({
|
||||
title:
|
||||
err.msg || err.response.data.msg || err.response.data.message,
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
@ -743,10 +697,9 @@ export default {
|
||||
productId: that.id,
|
||||
cartNum: that.attr.productSelect.cart_num,
|
||||
new: news,
|
||||
uniqueId:
|
||||
that.attr.productSelect !== undefined
|
||||
? that.attr.productSelect.unique
|
||||
: "",
|
||||
uniqueId: that.attr.productSelect !== undefined ?
|
||||
that.attr.productSelect.unique :
|
||||
"",
|
||||
};
|
||||
postCartAdd(q)
|
||||
.then(function (res) {
|
||||
@ -755,8 +708,7 @@ export default {
|
||||
if (news) {
|
||||
if (!res.data) {
|
||||
uni.showToast({
|
||||
title:
|
||||
res.msg || res.data.msg || res.data.message,
|
||||
title: res.msg || res.data.msg || res.data.message,
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
@ -828,9 +780,9 @@ export default {
|
||||
if (this.isLogin) {
|
||||
getUserInfo().then((res) => {
|
||||
href =
|
||||
href.indexOf("?") === -1
|
||||
? href + "?spread=" + res.data.uid
|
||||
: href + "&spread=" + res.data.uid;
|
||||
href.indexOf("?") === -1 ?
|
||||
href + "?spread=" + res.data.uid :
|
||||
href + "&spread=" + res.data.uid;
|
||||
var configAppMessage = {
|
||||
desc: data.storeInfo,
|
||||
title: data.storeName,
|
||||
|
@ -6,20 +6,11 @@
|
||||
<input placeholder="搜索商品信息" v-model="where.keyword" />
|
||||
<text class="iconfont icon-sousuo" @click="submitForm"></text>
|
||||
</view>
|
||||
<view
|
||||
class="iconfont"
|
||||
:class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'"
|
||||
@click="switchTap"
|
||||
></view>
|
||||
<view class="iconfont" :class="Switch === true ? 'icon-pailie' : 'icon-tupianpailie'" @click="switchTap"></view>
|
||||
</view>
|
||||
</form>
|
||||
<view class="nav acea-row row-middle">
|
||||
<view
|
||||
class="item"
|
||||
:class="title ? 'font-color-red' : ''"
|
||||
@click="set_where(0)"
|
||||
>{{ title ? title : "默认" }}</view
|
||||
>
|
||||
<view class="item" :class="title ? 'font-color-red' : ''" @click="set_where(0)">{{ title ? title : "默认" }}</view>
|
||||
<view class="item" @click="set_where(1)">
|
||||
价格
|
||||
<image src="@/static/images/horn.png" v-if="price === 0" />
|
||||
@ -33,68 +24,62 @@
|
||||
<image src="@/static/images/down.png" v-if="stock === 2" />
|
||||
</view>
|
||||
<!-- down -->
|
||||
<view
|
||||
class="item"
|
||||
:class="nows ? 'font-color-red' : ''"
|
||||
@click="set_where(3)"
|
||||
>新品</view
|
||||
>
|
||||
<view class="item" :class="nows ? 'font-color-red' : ''" @click="set_where(3)">新品</view>
|
||||
</view>
|
||||
<view
|
||||
class="list acea-row row-between-wrapper"
|
||||
:class="Switch === true ? '' : 'on'"
|
||||
ref="container"
|
||||
>
|
||||
<view
|
||||
@click="goGoodsCon(item)"
|
||||
class="item"
|
||||
:class="Switch === true ? '' : 'on'"
|
||||
v-for="(item, productListIndex) in productList"
|
||||
:key="productListIndex"
|
||||
:title="item.storeName"
|
||||
>
|
||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container"
|
||||
v-if="isIntegral=='false'">
|
||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'"
|
||||
v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||
</view>
|
||||
<view class="text" :class="Switch === true ? '' : 'on'">
|
||||
<view class="name line1">{{ item.storeName }}</view>
|
||||
<view
|
||||
class="money font-color-red"
|
||||
:class="Switch === true ? '' : 'on'"
|
||||
>
|
||||
<view class="money font-color-red" :class="Switch === true ? '' : 'on'">
|
||||
¥
|
||||
<text class="num">{{ item.price }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="vip acea-row row-between-wrapper"
|
||||
:class="Switch === true ? '' : 'on'"
|
||||
>
|
||||
<view class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
|
||||
<view class="vip-money">¥{{ item.otPrice }}</view>
|
||||
<view>已售{{ item.sales }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'" ref="container"
|
||||
v-if="isIntegral=='true'">
|
||||
<view @click="goGoodsCon(item)" class="item" :class="Switch === true ? '' : 'on'"
|
||||
v-for="(item, productListIndex) in productList" :key="productListIndex" :title="item.storeName">
|
||||
<view class="pictrue" :class="Switch === true ? '' : 'on'">
|
||||
<image :src="item.image" :class="Switch === true ? '' : 'on'" />
|
||||
</view>
|
||||
<view class="text" :class="Switch === true ? '' : 'on'">
|
||||
<view class="name line1">{{ item.storeName }}</view>
|
||||
<view class="money font-color-red" :class="Switch === true ? '' : 'on'">
|
||||
<text class="num">{{ item.price }}积分</text>
|
||||
</view>
|
||||
<view class="vip acea-row row-between-wrapper" :class="Switch === true ? '' : 'on'">
|
||||
<!-- <view class="vip-money">¥{{ item.otPrice }}</view> -->
|
||||
<view>已售{{ item.sales }}件</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Loading :loaded="loadend" :loading="loading"></Loading>
|
||||
<view
|
||||
class="noCommodity"
|
||||
style="background-color: #fff"
|
||||
v-if="productList.length === 0 && where.page > 1"
|
||||
>
|
||||
<view class="noCommodity" style="background-color: #fff" v-if="productList.length === 0 && where.page > 1">
|
||||
<view class="noPictrue">
|
||||
<image src="@/static/images/noGood.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
<Recommend
|
||||
v-if="productList.length === 0 && where.page > 1"
|
||||
:recommendLoading="recommendLoading"
|
||||
@changeRecommendLoading="changeRecommendLoading"
|
||||
></Recommend>
|
||||
<Recommend v-if="productList.length === 0 && where.page > 1" :recommendLoading="recommendLoading"
|
||||
@changeRecommendLoading="changeRecommendLoading"></Recommend>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import Recommend from "@/components/Recommend";
|
||||
import { getProducts } from "@/api/store";
|
||||
import {
|
||||
getProducts,getProductsIntegral
|
||||
} from "@/api/store";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
@ -132,6 +117,7 @@ export default {
|
||||
nows: false,
|
||||
recommendLoading: false,
|
||||
target: false,
|
||||
isIntegral: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -152,20 +138,23 @@ export default {
|
||||
// this.$set(this, "productList", []);
|
||||
// this.price = 0;
|
||||
// this.stock = 0;
|
||||
// this.get_product_list();
|
||||
// this.getProductList();
|
||||
// }
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
const { s = "", id = 0, title = "" } = this.$yroute.query;
|
||||
const {
|
||||
s = "", id = 0, title = "", isIntegral = false
|
||||
} = this.$yroute.query;
|
||||
this.where.keyword = s;
|
||||
|
||||
this.where.isIntegral = isIntegral == 'true' ? 1 : 0;
|
||||
this.isIntegral = isIntegral
|
||||
this.updateTitle();
|
||||
this.get_product_list();
|
||||
this.getProductList();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.recommendLoading = true;
|
||||
!this.loading && this.get_product_list();
|
||||
!this.loading && this.getProductList();
|
||||
},
|
||||
onHide() {
|
||||
// this.hostProduct = [];
|
||||
@ -196,17 +185,20 @@ export default {
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: {
|
||||
id: item.id,
|
||||
isIntegral:this.isIntegral
|
||||
},
|
||||
});
|
||||
},
|
||||
updateTitle() {
|
||||
// document.title = this.title || this.$yroute.meta.title;
|
||||
},
|
||||
get_product_list() {
|
||||
getProductList() {
|
||||
var that = this;
|
||||
this.setWhere();
|
||||
// if (to.name !== "GoodsList") return;
|
||||
const { s = "", id = 0, title = "" } = this.$yroute.query;
|
||||
const {
|
||||
s = "", id = 0, title = ""
|
||||
} = this.$yroute.query;
|
||||
if (s !== this.where.keyword || id !== this.where.sid) {
|
||||
this.loadend = false;
|
||||
this.loading = false;
|
||||
@ -217,10 +209,11 @@ export default {
|
||||
this.$set(this, "productList", []);
|
||||
this.price = 0;
|
||||
this.stock = 0;
|
||||
// this.get_product_list();
|
||||
// this.getProductList();
|
||||
}
|
||||
let q = that.where;
|
||||
getProducts(q).then((res) => {
|
||||
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
|
||||
getData(q).then((res) => {
|
||||
that.loading = false;
|
||||
if (that.target) {
|
||||
that.productList = res.data;
|
||||
@ -237,7 +230,7 @@ export default {
|
||||
this.where.page = 1;
|
||||
this.loadend = false;
|
||||
this.loading = false;
|
||||
this.get_product_list();
|
||||
this.getProductList();
|
||||
},
|
||||
//点击事件处理
|
||||
set_where: function (index) {
|
||||
@ -270,7 +263,7 @@ export default {
|
||||
that.where.page = 1;
|
||||
that.target = true;
|
||||
that.loadend = false;
|
||||
that.get_product_list();
|
||||
that.getProductList();
|
||||
},
|
||||
//设置where条件
|
||||
setWhere: function () {
|
||||
|
@ -114,11 +114,11 @@
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="item" @click="goPages2()">
|
||||
<view class="item" @click="goPages2()">
|
||||
<view class="pictrue"></view>
|
||||
<view class="cell">hexiao</view>
|
||||
<view class="cell">积分商城</view>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -353,7 +353,13 @@
|
||||
},
|
||||
goPages2: function () {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/orderAdmin/OrderCancellation/index"
|
||||
path: "/pages/shop/GoodsList/index",
|
||||
query: {
|
||||
// id: 0,
|
||||
title: '积分商城',
|
||||
isIntegral: true,
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user