| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403 |
- <!-- type 1拼多多 2淘宝 -->
- <template>
- <div class="container">
- <div
- class="l_tabBar flex_r flex_jb"
- >
- <div class="search-box flex_r flex_jb">
- <div class="search flex_r flex_jb flex_ac">
- <span class="iconfont"></span>
- <input
- v-model="keyword"
- @confirm="toSearch"
- class="inp"
- placeholder="搜索你要的内容"
- />
- <span class="search_btn" @click="toSearch">搜索</span>
- </div>
- </div>
- </div>
- <!-- 平台-start -->
- <div class="nav_box flex_r">
- <div
- class="item flex_c flex_ac"
- v-for="(i, s) in platform"
- :key="s"
- @click="toPlatform(i,s)"
- >
- <uni-badge
- size="small"
- :text="i.badge"
- absolute="rightTop"
- type="error"
- >
- <img :src="i.image" alt="" class="ico" />
- </uni-badge>
- <div class="tit">{{ i.name }}</div>
- <div class="tit1">{{ i.text }}</div>
- </div>
- </div>
- <!-- 平台-end -->
- <!-- 平台切换-start -->
- <div class="flex_r flex_ac">
- <div
- :class="navIndex == s ? 'nav nav-active' : 'nav'"
- v-for="(i, s) in platform"
- :key="s"
- @click="changeNav(i, s)"
- >
- <span>{{ i.name }}</span>
- </div>
- </div>
- <!-- 平台切换-end -->
- <!-- 平台下分类-start -->
- <div class="sort_box flex_r flex_ac">
- <div
- :class="sortIndex == s ? 'sort sort-active' : 'sort'"
- v-for="(i, s) in sort"
- :key="s"
- @click="search(i, s)"
- >
- <span>{{ i.cat_name }}</span>
- </div>
- </div>
- <view class="product-list" v-if="goods.length > 0 && platformObj.type == 8">
- <view
- class="product"
- v-for="(i, s) in goods"
- :key="s"
- @click="NavToGoodsDetail(i)"
- >
- <view class="image-view">
- <image class="product-image" :src="i.goods.original_img"></image>
- </view>
- <view class="content-view">
- <view :class="['product-title', 'ellipsis2']">{{
- i.goods_name
- }}</view>
- <view class="product-price">
- <text class="product-price-original product-price-original1">{{ i.cost_price }}</text>
- <text class="product-text" v-if="['3', '4'].includes(type)"
- >赠<text class="corFE2C15">{{ i.give_cha_bao }}</text
- >贡献值</text
- >
- </view>
- <view class="product-txt" v-if="type == 4">
- <text class="product-price-favour">¥{{ i.market_price }}</text>
- <text class="product-text">消费券抵</text>
- <span class="corFE2C15">¥{{ Number(i.consume) }}</span>
- </view>
- <!-- <view class="product-txt" v-if="type == 1">赠送{{ i.give_integral + "批发券" }}</view> -->
- <view class="product-txt" v-if="type == 6"
- >每<text class="green">{{ i.interval_time }}</text> 分钟降价
- <text class="green">{{ i.drop_range * 100 }}%</text>
- </view>
- <view class="product-txt" v-if="['3'].includes(type)"
- >限时赠送<text class="corFE2C15">{{ i.teac }}</text
- >TeaC</view
- >
- <view class="product-txt fenxiang" v-if="['3'].includes(type)">
- <text class="iconfont red"></text>
- <text class="red"
- >分享约获得{{ i.first_teac
- }}{{ type == 3 ? "TeaC" : "现金" }}</text
- >
- </view>
- <view v-if="['4'].includes(type)" class="flex_r flex_ac">
- <view class="product-txt"
- >赠<text class="corFE2C15">{{ i.teac }}</text
- >TeaC</view
- >
- <!-- <view class="product-txt fenxiang" style="background-color: rgba(0, 0, 0, 0);">
- <text class="iconfont red"></text>
- <text class="red"
- >{{ i.first_teac }}</text
- >
- </view> -->
- </view>
- </view>
- </view>
- </view>
- <!-- 平台下分类-end -->
- <view class="product-list" v-if="goods.length > 0 && platformObj.type != 5 && platformObj.type != 8">
- <view
- class="product"
- v-for="(i, s) in goods"
- :key="s"
- @click="NavToGoodsDetail(i)"
- >
- <view class="image-view" v-if="platformObj.type == 1">
- <image class="product-image" :src="i.goods_image_url"></image>
- </view>
- <view class="image-view" v-else-if="platformObj.type == 2">
- <image
- class="product-image"
- :src="i.item_basic_info.pict_url"
- ></image>
- </view>
- <view class="image-view" v-else-if="platformObj.type == 3">
- <image
- class="product-image"
- :src="i.imageInfo.imageList[0].url"
- ></image>
- </view>
- <view class="content-view">
- <view :class="['product-title', 'ellipsis2']">
- <span class="product-type">
- {{ platformObj.name }}
- </span>
- <span v-if="platformObj.type == 1">{{ i.goods_name }}</span>
- <span v-else-if="platformObj.type == 2">{{
- i.item_basic_info.title
- }}</span>
- <span v-else-if="platformObj.type == 3">{{ i.skuName }}</span>
- </view>
- <!-- 拼多多 -->
- <template v-if="platformObj.type == 1">
- <view class="quan_box flex_r flex_as flex_wrap">
- <view class="quan" v-if="i.has_coupon">
- <span class="pl">券</span>
- <span>¥{{ i.coupon_discount / 100 }}</span>
- </view>
- <view class="quan">
- <span>赠付宝:</span>
- <span>
- {{
- Math.floor(
- (i.min_group_price / 100) *
- (i.promotion_rate / 1000) *
- platformObj.ratio *
- 100
- ) / 100
- }}
- </span>
- </view>
- <view class="quan">
- <span>赠贡献值:</span>
- <span>
- {{
- Math.floor(
- (i.min_group_price / 100 - i.coupon_discount / 100) *
- platformObj.chabao *
- 100
- ) / 100
- }}
- </span>
- </view>
- </view>
- <view class="product-price">
- <text class="product-price-original">
- {{
- Math.floor(
- (i.min_group_price / 100 - i.coupon_discount / 100) * 100
- ) / 100
- }}
- </text>
- <text class="product-price-favour"
- >¥{{ i.min_group_price / 100 }}</text
- >
- </view>
- </template>
- <!-- 淘宝 -->
- <template v-else-if="platformObj.type == 2">
- <view class="quan_box flex_r flex_as flex_wrap">
- <view class="quan" v-if="i.coupon_discount > 0">
- <span class="pl">券</span>
- <span>¥{{ i.coupon_discount }}</span>
- </view>
- <view class="quan">
- <span>赠付宝:</span>
- <span>
- {{
- Math.floor(
- ((i.price_promotion_info.final_promotion_price *
- i.publish_info.income_rate) /
- 100) *
- platformObj.ratio *
- 100
- ) / 100
- }}
- </span>
- </view>
- <view class="quan">
- <span>赠贡献值:</span>
- <span>
- {{
- Math.floor(
- i.price_promotion_info.final_promotion_price *
- platformObj.chabao *
- 100
- ) / 100
- }}
- </span>
- </view>
- </view>
- <view class="product-price">
- <text class="product-price-original">
- <!-- // Math.floor(
- // (i.min_group_price / 100 - i.coupon_discount / 100) * 100
- // ) / 100 -->
- {{ i.price_promotion_info.final_promotion_price }}
- </text>
- <text class="product-price-favour">
- ¥{{ i.price_promotion_info.zk_final_price }}
- </text>
- </view>
- </template>
- <!-- 京东 -->
- <template v-else-if="platformObj.type == 3">
- <view class="quan_box flex_r flex_as flex_wrap">
- <view class="quan" v-if="i.coupon_discount > 0">
- <span class="pl">券</span>
- <span>¥{{ i.coupon_discount }}</span>
- </view>
- <view class="quan">
- <span>赠付宝:</span>
- <span>
- {{
- Math.floor(
- ((i.priceInfo.lowestCouponPrice *
- i.commissionInfo.commissionShare) /
- 100) *
- platformObj.ratio *
- 100
- ) / 100
- }}
- </span>
- </view>
- <view class="quan">
- <span>赠贡献值:</span>
- <span>
- {{
- Math.floor(
- i.priceInfo.lowestCouponPrice * platformObj.chabao * 100
- ) / 100
- }}
- </span>
- </view>
- </view>
- <view class="product-price">
- <text class="product-price-original">
- <!-- // Math.floor(
- // (i.min_group_price / 100 - i.coupon_discount / 100) * 100
- // ) / 100 -->
- {{ i.priceInfo.lowestCouponPrice }}
- </text>
- <text class="product-price-favour">
- ¥{{ i.priceInfo.price }}
- </text>
- </view>
- </template>
- <!-- 美团 -->
- <template v-else-if="platformObj.type == 5">
- <view class="quan_box flex_r flex_as flex_wrap">
- <!-- <view class="quan" v-if="i.coupon_discount > 0">
- <span class="pl">券</span>
- <span>¥{{ i.coupon_discount }}</span>
- </view> -->
- <view class="quan">
- <span>赠付宝:</span>
- <span>
- {{
- Math.floor(
- (i.couponPackDetail.sellPrice *
- Number(i.commissionInfo.commissionPercent) /
- 10000) *
- platformObj.ratio *
- 100
- ) / 100
- }}
- </span>
- </view>
- <view class="quan">
- <span>赠贡献值:</span>
- <span>
- {{
- Math.floor(
- i.couponPackDetail.sellPrice * platformObj.chabao * 100
- ) / 100
- }}
- </span>
- </view>
- </view>
- <view class="product-price">
- <text class="product-price-original">
- <!-- // Math.floor(
- // (i.min_group_price / 100 - i.coupon_discount / 100) * 100
- // ) / 100 -->
- {{ i.couponPackDetail.sellPrice }}
- </text>
- <text class="product-price-favour">
- ¥{{ i.couponPackDetail.originalPrice }}
- </text>
- </view>
- </template>
- </view>
- </view>
- </view>
- <view class="product-list" v-if="goods.length > 0 && platformObj.type == 5">
- <view
- class="product type5"
- v-for="(i, s) in goods"
- :key="s"
- >
- <view class="flex_r flex_jb flex_ac">
- <view class="image-view">
- <image
- class="product-image"
- :src="i.couponPackDetail.headUrl"
- ></image>
- </view>
- <view class="content-view">
- <view :class="['product-title', 'ellipsis2']">
- <span class="product-type">
- {{ platformObj.name }}
- </span>
- <span>{{ i.couponPackDetail.name }}</span>
- </view>
- <view class="flex_r flex_jb flex_ae">
- <view class="product-price">
- <text class="product-price-original">
- {{ i.couponPackDetail.sellPrice }}
- </text>
- <text class="product-price-favour"
- >¥{{ i.couponPackDetail.originalPrice }}</text
- >
- </view>
- <view class="buyed"> {{ i.couponPackDetail.saleVolume }} </view>
- </view>
- <view class="quan_box flex_r flex_as flex_wrap">
- <!-- <view class="quan" v-if="i.coupon_discount > 0">
- <span class="pl">券</span>
- <span>¥{{ i.coupon_discount }}</span>
- </view> -->
- <view class="quan">
- <span>赠付宝:</span>
- <span>
- {{
- Math.floor(
- (i.couponPackDetail.sellPrice *
- Number(i.commissionInfo.commissionPercent) /
- 10000) *
- platformObj.ratio *
- 100
- ) / 100
- }}
- </span>
- </view>
- <view class="quan">
- <span>赠贡献值:</span>
- <span>
- {{
- Math.floor(
- i.couponPackDetail.sellPrice * platformObj.chabao * 100
- ) / 100
- }}
- </span>
- </view>
- </view>
- <view class="shop"> {{ i.brandInfo.brandName || i.deliverablePoiInfo.poiName || "美团外卖" }} </view>
- </view>
- </view>
- <view class="flex_r flex_ac flex_jb ">
- <view class="mtBtn1" @click="copyMt(i)">分享好友</view>
- <view class="mtBtn2" @click="toMt(i)">立即抢券</view>
- </view>
- </view>
- </view>
- <not-goods v-if="goods.length <= 0" textStr="暂无数据"></not-goods>
- <!-- 精品推荐-end -->
- <view class="fz_w_text">好生活,茶付宝!</view>
- </div>
- </template>
- <script>
- let page = 1;
- import { post } from "@/request/api.js";
- import uniCopy from "@/utils/copy";
- import notGoods from "@/components/not-goods/index.vue";
- export default {
- components: { notGoods },
- data() {
- return {
- goods: [], // 商品列表
- haveGoods: false, // 是否有商品
- platform: [], //平台
- navIndex: 0, // 平台索引
- sort: [], //分类
- sortIndex: 0, // 分类索引
- head: false,
- keyword: "", // 搜索关键字
- banner: {}, // 顶部背景图
- ratio: 0, // 比例
- platformObj: {
- type: 8,
- }, // 选中平台
- catObj: {
- cat_id: 0,
- cat_name: "",
- }, //选中的分类
- type: 4, //享好物的固定类型
- categoryId: 11,
- };
- },
- async mounted() {
- // this.platform = [];
- // this.navIndex = 0;
- // this.platformObj = {
- // type: 1,
- // };
- // this.sortIndex = 0;
- // this.sort = [];
- // this.catObj = {
- // cat_id: 0,
- // cat_name: "",
- // };
- this.getIcon();
- uni.setTabBarStyle({
- color: "#999",
- selectedColor: "#E68B1E",
- });
- page = 1;
- this.goods = [];
- this.duoduoCats();
- this.goodsDay();
- this.$bus.$on("onReachBottom", (url) => {
- console.log(this.platformObj.type)
- if (page != -1) {
- setTimeout(() => {
- ++page;
- this.goodsDay();
- }, 500);
- }
- });
- },
- created(da) {
- this.getIcon();
- uni.setTabBarStyle({
- color: "#999",
- selectedColor: "#E68B1E",
- });
- this.duoduoCats();
- this.goodsDay();
- },
- onHide() {},
- onPageScroll(e) {
- // if (e.scrollTop > 0) {
- // this.head = true;
- // } else {
- // this.head = false;
- // }
- },
- methods: {
- // 获取平台
- getIcon() {
- post("v1/cashback/getIcon", {isApp: 1}).then((res) => {
- if (res.code === 0) {
- this.platform = res.data;
- this.platform.length = 5; // 后期要去掉
- this.platformObj = this.platform[this.navIndex];
- this.ratio = this.platform[this.navIndex].ratio;
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 获取拼多多平台下的分类
- duoduoCats() {
- post("v1/cashback/duoduoCats").then((res) => {
- if (res.code === 0) {
- if (this.platformObj.type == 1) {
- this.sort = res.data.cats;
- }
- this.banner = res.data.banner[0];
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 获取淘宝平台下的分类
- taobaoCats() {
- post("v1/cashback/taobaoCats").then((res) => {
- if (res.code === 0) {
- this.sort = res.data.cats;
- this.catObj = this.sort[0];
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 获取京东平台下的分类
- jingdongCats() {
- post("v1/cashback/jingdongCats").then((res) => {
- if (res.code === 0) {
- this.sort = res.data.cats;
- this.catObj = this.sort[0];
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 获取美团平台下的分类
- meituanCats() {
- post("v1/cashback/meituanCats").then((res) => {
- if (res.code === 0) {
- this.sort = res.data.cats;
- this.catObj = this.sort[0];
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 切换平台
- changeNav(item, index) {
- this.sortIndex = 0;
- this.catObj = {
- cat_id: 0,
- cat_name: "",
- };
- this.sort = [];
- this.platformObj = item;
- this.navIndex = index;
- if (this.platformObj.type == 1) {
- this.duoduoCats();
- } else if (this.platformObj.type == 2) {
- this.taobaoCats();
- } else if (this.platformObj.type == 3) {
- this.jingdongCats();
- } else if (this.platformObj.type == 5) {
- this.meituanCats();
- }
- page = 1;
- this.goods = [];
- this.goodsDay();
- },
- // 跳转
- toPage(url) {
- this.goto(url);
- },
- toSearch() {
- page = 1;
- this.goods = [];
- this.goodsDay();
- },
- // 搜索/切换分类
- search(item, index) {
- this.catObj = item;
- this.sortIndex = index;
- page = 1;
- this.goods = [];
- this.goodsDay();
- },
- // 获取商品列表
- async goodsDay() {
- uni.showLoading();
- let that = this;
- let data = {};
- if (this.platformObj.type == 1) {
- // post("v1/cashback/taobaoList",{cat:"女装"}).then((res) => {
- data = { p: page, cat_id: this.catObj.cat_id, keyword: this.keyword };
- post("v1/cashback/duoduoList", data)
- .then((res) => {
- uni.hideLoading();
- if (res.code === 0) {
- let obj = JSON.parse(res.data).goods_search_response.goods_list;
- console.log(obj);
- if (page <= 1) that.goods = [];
- if (obj.length > 0) {
- obj.forEach((e) => {
- that.goods.push(e);
- });
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- })
- .catch((e) => {
- uni.hideLoading();
- });
- } else if (this.platformObj.type == 2) {
- this.catObj.cat_name
- ? (data = {
- p: page,
- cat: this.catObj.cat_name,
- keyword: this.keyword,
- })
- : (data = { p: page, keyword: this.keyword });
- post("v1/cashback/taobaoList", data)
- .then((res) => {
- uni.hideLoading();
- if (res.code === 0) {
- console.log(JSON.parse(res.data));
- let obj = JSON.parse(res.data)
- .tbk_dg_material_optional_upgrade_response.result_list.map_data;
- console.log(obj);
- obj.map((i) => {
- let arr =
- i.price_promotion_info?.final_promotion_path_list
- ?.final_promotion_path_map_data || [];
- if (arr.length > 0) {
- for (let ii = 0; ii < arr.length; ii++) {
- if (arr[ii].promotion_title == "商品券") {
- i.coupon_discount = arr[ii].promotion_fee;
- i.promotion_start_time = arr[ii].promotion_start_time;
- i.promotion_end_time = arr[ii].promotion_end_time;
- }
- }
- } else {
- i.coupon_discount = 0;
- i.promotion_start_time = 0;
- i.promotion_end_time = 0;
- }
- return i;
- });
- if (page <= 1) that.goods = [];
- if (obj.length > 0) {
- obj.forEach((e) => {
- that.goods.push(e);
- });
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- })
- .catch((e) => {
- uni.hideLoading();
- });
- } else if (this.platformObj.type == 3) {
- this.catObj.cat_name
- ? (data = {
- p: page,
- cat_id: this.catObj.cat_id,
- keyword: this.keyword,
- })
- : (data = { p: page, keyword: this.keyword });
- post("v1/cashback/jingdongList", data)
- .then((res) => {
- uni.hideLoading();
- if (res.code === 0) {
- let obj = JSON.parse(
- res.data.jd_union_open_goods_query_responce.queryResult
- ).data;
- console.log(obj);
- obj.map((i) => {
- if (i.couponInfo.couponList.length > 0) {
- let arr = i.couponInfo.couponList;
- for (let ii = 0; ii < arr.length; ii++) {
- if (arr[ii].isBest == 1) {
- i.coupon_discount = arr[ii].discount;
- i.promotion_start_time = arr[ii].useStartTime;
- i.promotion_end_time = arr[ii].useEndTime;
- } else {
- let couponInfo = i.couponInfo.couponList[0] || {};
- i.coupon_discount = couponInfo.discount || 0;
- i.promotion_start_time = couponInfo.useStartTime || 0;
- i.promotion_end_time = couponInfo.useEndTime || 0;
- }
- }
- } else {
- i.coupon_discount = 0;
- i.promotion_start_time = 0;
- i.promotion_end_time = 0;
- }
- return i;
- });
- if (page <= 1) that.goods = [];
- if (obj.length > 0) {
- obj.forEach((e) => {
- that.goods.push(e);
- });
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- })
- .catch((e) => {
- uni.hideLoading();
- });
- } else if (this.platformObj.type == 5) {
- let { lat, lng } = await uni.Location();
- this.catObj.cat_name
- ? (data = {
- pageNo: page,
- listTopiId: this.catObj.cat_id,
- searchText: this.keyword,
- latitude: lat,
- longitude: lng,
- })
- : (data = {
- pageNo: page,
- searchText: this.keyword,
- latitude: lat,
- longitude: lng,
- listTopiId: 2,
- });
- console.log(data);
- uni.request({
- url: "https://meituan-java.chafubao.cn/query_coupon", //仅为示例,并非真实接口地址。
- method: "POST",
- header: {
- token: uni.getStorageSync("token"),
- "Content-Type": "application/x-www-form-urlencoded",
- },
- data: data,
- success: (res) => {
- uni.hideLoading();
- console.log(res.data);
- if (res.data.statusCode === 200) {
- let obj = JSON.parse(
- res.data.body
- ).data;
- console.log(obj);
- if (page <= 1) that.goods = [];
- if (obj.length > 0) {
- obj.forEach((e) => {
- that.goods.push(e);
- });
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
-
- },
- fail: (error) => {
- uni.hideLoading();
- }
- });
- } else if (this.platformObj.type == 8) {
- let that = this;
- let data = { page, type: 4, category_id: 11 };
- post("v1/goods/categoryInfo", data).then((res) => {
- if (res.code === 0) {
- let obj = res.data.data.data;
- console.log(obj);
- if (page <= 1) that.goods = [];
- if (obj.length > 0) {
- obj.forEach((e) => {
- that.goods.push(e);
- });
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- }
- uni.hideLoading();
- } else {
- if (page == 1) {
- that.haveGoods = true;
- page = -1;
- } else {
- page = -1;
- this.$toast("暂无更多");
- }
- uni.hideLoading();
- }
- });
- }
- },
- toPlatform(i,s) {
- if(i.url) {
- this.goto(i.url + '&name=' + i.name)
- } else {
- this.changeNav(i, s);
- }
- },
- // 跳转到商品详情页
- NavToGoodsDetail(item) {
- if (this.platformObj.type == 1) {
- this.goto("/pagesC/shoppingMallType/p_details", {
- goods_sign: item.goods_sign,
- type: this.platformObj.type,
- });
- } else if (this.platformObj.type == 2) {
- this.goto("/pagesC/shoppingMallType/p_details", {
- item_id: item.item_id,
- type: this.platformObj.type,
- annual_vol: item.item_basic_info.annual_vol,
- yj_price:
- Math.floor(
- ((item.price_promotion_info.final_promotion_price *
- item.publish_info.income_rate) /
- 100) *
- this.platformObj.ratio *
- 100
- ) / 100 || 0,
- goods_price: item.price_promotion_info.final_promotion_price,
- coupon_discount: item.coupon_discount,
- promotion_start_time: item.promotion_start_time,
- promotion_end_time: item.promotion_end_time,
- });
- } else if (this.platformObj.type == 3) {
- console.log(item);
- this.goto("/pagesC/shoppingMallType/p_details", {
- item_id: item.itemId,
- type: this.platformObj.type,
- annual_vol: item.inOrderCount30Days,
- yj_price:
- Math.floor(
- ((item.priceInfo.lowestCouponPrice *
- item.commissionInfo.commissionShare) /
- 100) *
- this.platformObj.ratio *
- 100
- ) / 100 || 0,
- goods_price: item.priceInfo.lowestCouponPrice,
- goods_price_origin: item.priceInfo.price,
- coupon_discount: item.coupon_discount,
- shopName: item.shopInfo.shopName,
- promotion_start_time: item.promotion_start_time,
- promotion_end_time: item.promotion_end_time,
- });
- } else if (this.platformObj.type == 8) {
- this.goto("/pages/product/p_details", { id: item.id, type: 4 });
- }
- },
- copyMt(item){
- uni.request({
- url: "https://meituan-java.chafubao.cn/get_referral_link",
- method: "POST",
- header: {
- token: uni.getStorageSync("token"),
- "Content-Type": "application/x-www-form-urlencoded",
- },
- data: {
- skuViewId: item.couponPackDetail.skuViewId,
- linkType: 2,
- sid: uni.getStorageSync("userinfo").user_id
- },
- success: (res) => {
- uni.hideLoading();
- console.log(res.data);
- if (res.data.statusCode === 200) {
- let url = JSON.parse(
- res.data.body
- ).data;
- uniCopy({
- content: url,
- success: (res1) => {
- uni.showToast({
- title: "链接已复制",
- icon: "none",
- duration: 2000,
- });
- },
- error: (e) => {},
- });
- }
-
- },
- fail: (error) => {
- uni.hideLoading();
- }
- });
- },
- // 前往美团小程序
- toMt(item){
- uni.request({
- url: "https://meituan-java.chafubao.cn/get_referral_link",
- method: "POST",
- header: {
- token: uni.getStorageSync("token"),
- "Content-Type": "application/x-www-form-urlencoded",
- },
- data: {
- skuViewId: item.couponPackDetail.skuViewId,
- linkType: 4,
- sid: uni.getStorageSync("userinfo").user_id
- },
- success: (res) => {
- uni.hideLoading();
- console.log(res.data);
- if (res.data.statusCode === 200) {
- let url = JSON.parse(
- res.data.body
- ).data;
- wx.navigateToMiniProgram({
- appId: "wxde8ac0a21135c07d",
- path: url,
- extraData: {
- },
- envVersion: "release",
- success(res) {
- // 打开成功
- // _this.$refs.popup.close();
- },
- });
- }
-
- },
- fail: (error) => {
- uni.hideLoading();
- }
- });
-
- }
- },
- //页面上拉触底事件的处理函数
- onReachBottom() {
- if (page != -1) {
- setTimeout(() => {
- ++page;
- this.goodsDay();
- }, 500);
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- // 页面配置
- page {
- background: #f5f5f5;
- }
- .head {
- width: 100%;
- height: 160rpx;
- text-align: center;
- position: fixed;
- top: 0;
- z-index: 999;
- // padding: calc(var(--status-bar-height) + 50rpx) 0 36rpx;
- background: #fff;
- .title {
- font-size: 16px;
- font-weight: 600;
- padding-top: calc(var(--status-bar-height) + 46rpx);
- }
- }
- // 页面配置-end
- .product-list {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- flex-direction: row;
- padding: 0 30rpx;
- .product {
- width: 48.5%;
- margin-bottom: 20rpx;
- padding-bottom: 12rpx;
- border-radius: 10rpx;
- box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.06);
- background-color: #fff;
- &:nth-child(2n) {
- margin-left: 3%;
- }
- }
- .type5{
- width: 100%;
- margin-bottom: 20rpx;
- padding: 12rpx;
- border-radius: 10rpx;
- box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.06);
- background-color: #fff;
- &:nth-child(2n) {
- margin-left: 0%;
- }
- .product-image {
- border-radius: 10rpx;
- width: 29vw;
- height: 29vw;
- object-fit: cover;
- }
- .content-view {
- width: calc(100% - 29vw);
- padding: 0 16rpx;
- box-sizing: border-box;
- }
- .shop {
- font-size: 22rpx;
- color: #c4c4c4;
- }
- .buyed {
- color: #888888;
- font-size: 22rpx;
- margin: 16rpx 0 4rpx;
- }
- .quan_box {
- min-height: 0;
- font-size: 20rpx;
- color: #e90406;
- margin: 12rpx 0 14rpx;
- }
- .mtBtn1{
- width: 45%;
- color: #FE6232;
- text-align: center;
- font-size: 26rpx;
- font-weight: bold;
- letter-spacing: 2rpx;
- padding: 10rpx 0;
- border-radius: 50rpx;
- border: 1rpx solid #FE6232;
- margin-top: 15rpx;
- }
- .mtBtn2{
- width: 45%;
- color: #fff;
- text-align: center;
- font-size: 26rpx;
- font-weight: bold;
- letter-spacing: 2rpx;
- padding: 10rpx 0;
- border-radius: 50rpx;
- border: 1rpx solid #FE6232;
- background-color: #FE6232;
- margin-top: 15rpx;
- }
- }
- .product-image {
- border-radius: 10rpx 10rpx 0 0;
- width: 100%;
- height: 42.3vw;
- object-fit: cover;
- }
- .content-view {
- padding: 0 16rpx;
- }
- .product-title {
- width: 100%;
- overflow: hidden;
- line-height: 1.5;
- font-size: 26rpx;
- height: 80rpx;
- font-weight: bold;
- color: #121212;
- }
- .product-type {
- font-size: 16rpx;
- font-weight: bold;
- color: #fff;
- height: 26rpx;
- display: inline-block;
- line-height: 26rpx;
- padding: 0 8rpx;
- border-radius: 4rpx;
- margin-right: 16rpx;
- background-color: #e90406;
- }
- .product-price {
- color: #121212;
- font-size: 28rpx;
- // position: relative;
- margin: 16rpx 0 4rpx;
- }
- .product-price-original {
- color: #000;
- font-size: 32rpx;
- font-weight: bold;
- &:before {
- content: "¥";
- font-size: 20rpx;
- }
- }
- .product-price-original1 {
- color: #18bb88;
- font-size: 32rpx;
- font-weight: bold;
- &:before {
- content: "¥";
- font-size: 20rpx;
- }
- }
- .quan_box {
- min-height: 88rpx;
- font-size: 20rpx;
- color: #e90406;
- margin: 12rpx 0 0;
- .quan {
- padding: 2rpx 8rpx;
- border-radius: 8rpx;
- border: 1rpx solid rgba($color: #e90406, $alpha: 0.3);
- margin-right: 10rpx;
- margin-top: 6rpx;
- .pl {
- padding-right: 10rpx;
- }
- }
- }
- .product-price-favour {
- color: #888888;
- font-size: 22rpx;
- text-decoration: line-through;
- // margin-left: 20rpx;
- }
- .product-tip {
- position: absolute;
- right: 20rpx;
- background-color: #ff3333;
- color: #ffffff;
- padding: 0 20rpx;
- border-radius: 10rpx;
- }
- .product-unit {
- font-size: 24rpx;
- color: #18bb88;
- }
- .product-txt,
- .product-text {
- font-size: 22rpx;
- color: #787878;
- .iconfont {
- margin-right: 6rpx;
- }
- }
- .product-text {
- margin-left: 16rpx;
- }
- .red {
- color: #fa2e18;
- }
- .fenxiang {
- font-size: 20rpx;
- background: rgba(250, 46, 24, 0.08);
- display: inline-block;
- border-radius: 6rpx;
- padding: 0 16rpx;
- }
- }
- // 活动-end
- .l_tabBar {
- // height: 400rpx;
- flex-wrap: wrap;
- padding: 10rpx 20rpx;
- border-radius: 10rpx;
- margin: 0 0 30rpx;
- // background: url("https://img1.baidu.com/it/u=3052557249,4146060588&fm=253&fmt=auto&app=138&f=JPEG?w=1000&h=465")
- // no-repeat;
- // background-size: 100% 100%;
- .search-box {
- width: 100%;
- padding: 10rpx;
- // margin-top: 68rpx;
- margin-bottom: 12rpx;
- .district {
- font-size: 32rpx;
- font-weight: 600;
- color: #333;
- .iconfont {
- font-size: 20rpx;
- margin-left: 12rpx;
- }
- }
- .search {
- border: 1px solid #d78c2e;
- height: 60rpx;
- line-height: 60rpx;
- padding-left: 20rpx;
- border-radius: 31rpx;
- background-color: #fff;
- .iconfont {
- font-size: 30rpx;
- }
- .inp {
- font-size: 25rpx;
- padding: 0 8rpx;
- width: 500rpx;
- }
- .search_btn {
- background-color: #d78c2e;
- height: 100%;
- color: #fff;
- border-radius: 31rpx;
- font-size: 28rpx;
- padding: 0 28rpx;
- }
- }
- .scan-ico {
- font-size: 55rpx;
- }
- }
- }
- .nav_box {
- margin: -50rpx 0 10rpx;
- padding: 20rpx 20rpx;
- border-radius: 20rpx;
- flex-wrap: wrap;
- justify-content: space-between;
- background-color: #f5f6f8;
- .item {
- width: 17%;
- margin: 10rpx 10rpx;
- }
- .ico {
- width: 62rpx;
- height: 62rpx;
- }
- .tit {
- font-size: 24rpx;
- padding-top: 12rpx;
- }
- .tit1 {
- font-size: 20rpx;
- color: #a0a0a0;
- }
- }
- .nav {
- width: 25%;
- height: 40rpx;
- line-height: 40rpx;
- text-align: center;
- font-size: 28rpx;
- color: #a0a0a0;
- margin-bottom: 16rpx;
- }
- .nav:nth-child(2) {
- border-left: 1rpx solid rgba($color: #a0a0a0, $alpha: 0.5);
- border-right: 1rpx solid rgba($color: #a0a0a0, $alpha: 0.5);
- }
- .nav:nth-child(3) {
- border-right: 1rpx solid rgba($color: #a0a0a0, $alpha: 0.5);
- }
- .nav:nth-child(4) {
- border-right: 1rpx solid rgba($color: #a0a0a0, $alpha: 0.5);
- }
- .nav-active {
- color: #1f1f1f;
- }
- .sort_box {
- // position: sticky;
- position: -webkit-sticky;
- top: 110rpx;
- z-index: 999;
- left: 0;
- overflow: scroll;
- flex-wrap: nowrap;
- padding: 16rpx 0;
- margin: 0 30rpx 10rpx;
- background-color: #f5f6f8;
- .sort {
- white-space: nowrap;
- font-size: 23rpx;
- color: #a0a0a0;
- padding: 6rpx 15rpx;
- border-radius: 6rpx;
- border: 1rpx solid #fff;
- margin-right: 14rpx;
- background-color: #fff;
- }
- .sort-active {
- color: #15acda;
- border: 1rpx solid rgba($color: #58b0d9, $alpha: 0.5);
- background-color: rgba($color: #e3f3fd, $alpha: 1);
- }
- }
- .container {
- overflow: visible;
- }
- /* 隐藏滚动条 */
- ::-webkit-scrollbar {
- display: none;
- }
- </style>
|