Merge branch 'hotfix/618修复'
| | |
| | | |
| | | $goods = isset($result['data'][0]) ? $result['data'][0] : []; |
| | | |
| | | if(empty($goods['goods_id'])) return []; |
| | | if(empty($goods['product_id'])) return []; |
| | | |
| | | $goods = self::initDyDetailGoods($goods); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | |
| | | <head> |
| | | <title>æé³ä¸å
éæ¶ç§</title> |
| | | <meta charset="UTF-8" /> |
| | | <meta name="viewport" |
| | | content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> |
| | | <link rel="stylesheet" href="https://cdn.staticfile.org/minireset.css/0.0.2/minireset.css" /> |
| | | <link rel="stylesheet" href="https://at.alicdn.com/t/font_1534407_039yhnv7evxo.css" /> |
| | | <script src="https://cdn.staticfile.org/promise-polyfill/8.2.0/polyfill.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/vue/3.0.11/vue.global.js"></script> |
| | | <script src="https://cdn.staticfile.org/vant/3.2.4/vant.min.js"></script> |
| | | <script src="https://img.bc.haodanku.com/cms/SpaUtils.min.js"></script> |
| | | <script src="https://img.bc.haodanku.com/cdn/vant-touch-emulator.js"></script> |
| | | <link href="https://cdn.staticfile.org/vant/3.2.4/index.min.css" rel="stylesheet" /> |
| | | <link rel="stylesheet" href="https://img.bc.haodanku.com/cdn/locss.css" /> |
| | | <script src="https://img.bc.haodanku.com/cdn/tsUtils.js"></script> |
| | | <script type="text/javascript" src="https://img.ushopvip.com/js/uni-webview-js.js"></script> |
| | | <meta name="referrer" content="no-referrer" /> |
| | | <script |
| | | defer>document.write('<link rel="stylesheet" href="https://img.bc.haodanku.com/cms/dy_onebuy.css?t=' + (Date.now() - Date.now() % (60 * 1000 * 30)) + '"/>');</script> |
| | | </head> |
| | | |
| | | <body> |
| | | <template id="c-card"> |
| | | <div class="card row _ flex-c"> |
| | | <img class="cover" v-lazy="item.itempic" v-if="item.itempic" /> |
| | | <img class="cover" src="http://img.bc.fqapps.com/fudai13cae4ae6ef16739ed3b100a2ec39e97.gif" alt="" v-else /> |
| | | <div class="detail"> |
| | | <div class="title _ ellipsis-2"> |
| | | <img src="https://img.bc.haodanku.com/cms/1666250839" |
| | | style="display: inline-block;width: 0.28rem;height: 0.28rem;margin-bottom: -0.04rem;"> |
| | | {{ item.itemshorttitle || item.itemtitle }} |
| | | </div> |
| | | <div class="shop-name _ flex-c"> |
| | | <img class="icon" src="https://img.bc.haodanku.com/cms/1655963255" :alt="item.shop_name" /> |
| | | <span class="value">{{ item.shop_name }}</span> |
| | | </div> |
| | | <div class="price"> |
| | | <div class="end-price"> |
| | | <div class="label">æ¢è´ä»·</div> |
| | | <div class="value"> |
| | | ï¿¥<strong>{{ Number(item.itemendprice) }}</strong> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="btn-block"> |
| | | <div class="_ btn btn-order" v-on:click.capture="buy"> |
| | | <span>ç«å³æ¢è´</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template id="c-share"> |
| | | <div class="footer-share _ lr-c"> |
| | | <div id="share_href" v-on:click="handleShare"> |
| | | <div class="share-content _ flex-c"> |
| | | <i> |
| | | <svg xmlns="http://www.w3.org/2000/svg" id="svg-icon" data-name="å¾å± 1" viewBox="0 0 18 19.11"> |
| | | <title>å享</title> |
| | | <path class="cls-1" d="M17.5,8A2.5,2.5,0,1,0,15,5.5,2.5,2.5,0,0,0,17.5,8Z" transform="translate(-3 -2)" /> |
| | | <path class="cls-1" d="M6.5,14.5A2.5,2.5,0,1,0,4,12,2.5,2.5,0,0,0,6.5,14.5Z" |
| | | transform="translate(-3 -2)" /> |
| | | <path class="cls-2" d="M15,6.79,8.67,10.62" transform="translate(-3 -2)" /> |
| | | <path class="cls-2" d="M8.67,13.28,13.27,16" transform="translate(-3 -2)" /> |
| | | <path class="cls-1" d="M15.77,15.11a2.5,2.5,0,1,1-2.5,2.5A2.5,2.5,0,0,1,15.77,15.11Z" |
| | | transform="translate(-3 -2)" /> |
| | | </svg> |
| | | </i> |
| | | <span>å享好å</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template id="category"> |
| | | <div class="c-category" v-on:click.stop> |
| | | <div class="tab-wrapper _ flex-c"> |
| | | <div class="tabs _ flex-1"> |
| | | <van-tabs |
| | | class="scroll-nav" |
| | | v-model:active="activeValue" |
| | | ref="tabsRef" |
| | | @click-tab="onTabChange" |
| | | background="none" |
| | | :ellipsis="false" |
| | | > |
| | | <van-tab |
| | | v-for="item in list" |
| | | v-bind:key="item[valueKey]" |
| | | v-bind:name="item[valueKey]" |
| | | v-bind:title="item[labelKey]" |
| | | ></van-tab> |
| | | </van-tabs> |
| | | </div> |
| | | <div class="_ btn show-more" @click="toggleCateAllVisible"> |
| | | <i class="iconfont hdk-paixu2" :class="{open:allCateVisible}"></i> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="cate-all" toggle-status="hide" ref="cateAllRef"> |
| | | <ul> |
| | | <li |
| | | class="_ btn" |
| | | v-for="(item,index) in list" |
| | | v-bind:class="{active:activeValue === item[valueKey]}" |
| | | v-on:click="onCateChange(item,index)" |
| | | > |
| | | <div class="ellipsis-single">{{item[labelKey]}}</div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <div id="single-page-app" v-cloak> |
| | | <van-pull-refresh v-model="refreshing" @refresh="reGetListData"> |
| | | <van-list class="page-container" v-bind:loading="listData.loading" v-bind:finished="listData.finished" |
| | | v-on:load="getListData"> |
| | | <!-- åºé¨æç¤º --> |
| | | <template v-slot:finished v-if="listData.list.length"><span class="list-item-loading">-伿 å°åºå¦-</span></template> |
| | | <template v-slot:loading><span class="list-item-loading">æ°æ®æ£å¨èµ¶æ¥çè·¯ä¸...</span></template> |
| | | <div class="banner-wrapper" ref="bannerRef"> |
| | | <img class="free-banner" v-bind:src="banner" alt="" /> |
| | | </div> |
| | | <van-sticky class="fixed-box"> |
| | | <van-search v-model="searchValue" show-action placeholder="请è¾å
¥æç´¢å
³é®è¯/龿¥" @search="onSearch" |
| | | @clear="onSearchClear"> |
| | | <template v-slot:action> |
| | | <div class="_ flex-c-c" @click="onSearch">æç´¢</div> |
| | | </template> |
| | | </van-search> |
| | | <category |
| | | class="category" |
| | | :list="category.list" |
| | | :url-param-key="cateKey" |
| | | v-model:value="category.value" |
| | | @change="onCateChange" |
| | | value-key="cat_id" |
| | | label-key="cat_name" |
| | | ></category> |
| | | </van-sticky> |
| | | <div class="page-content" ref="list" v-bind:class="{'empty-list':!listData.list.length}"> |
| | | <div class="lists" ref="listsRef" v-if="listData.list.length || listData.finished"> |
| | | <card v-for="(item, index) in listData.list" v-bind:item="item" v-bind:key="item.itemid" |
| | | v-on:transfer="handleGoodsTransfer"></card> |
| | | </div> |
| | | <div class="empty" v-show="!listData.list.length && !loading && listData.finished"> |
| | | <div class="empty-box"> |
| | | <img src="http://img.bc.haodanku.com/cms/1627883509" /> |
| | | <div class="text">ææ æ°æ®~</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </van-list> |
| | | </van-pull-refresh> |
| | | <div class="back-top-wrap max-width" v-movable> |
| | | <div class="_ btn back-top" v-on:click="backTop" v-bind:class="{hide: scrollTop < 600}"></div> |
| | | </div> |
| | | <a class="back-link" v-if="fromLink" :href="fromLink"><i class="iconfont hdk-xiangyou"></i></a> |
| | | <share v-on:share="handleShare" v-bind:class="{hide:isScrollToDown}"></share> |
| | | <van-overlay v-bind:show="loading"> |
| | | <van-loading color="#0094ff"></van-loading> |
| | | </van-overlay> |
| | | </div> |
| | | <script> |
| | | function useBase() { |
| | | const listDataStr = JSON.stringify({ |
| | | list: [], |
| | | loading: false, |
| | | finished: false, |
| | | min_id: 1, |
| | | pageTotal: 1, |
| | | pageCurrent: 0, |
| | | }); |
| | | |
| | | const scrollTop = Vue.ref(0); |
| | | const listData = Vue.reactive(JSON.parse(listDataStr)); |
| | | |
| | | // æ ¹æ®å¾®ä¿¡æµè§å¨ç¼©æ¾æ¯ä¾è®¾ç½®remç¼©æ¾ |
| | | if (SpaUtils.inWechat() && "ontouchstart" in window) { |
| | | const scale = SpaUtils.getFontScale(true); |
| | | document.documentElement.style.fontSize = |
| | | "calc(13.33333vw * " + scale + ")"; |
| | | } |
| | | |
| | | return { |
| | | listDataStr, |
| | | data: { |
| | | scrollTop, |
| | | listData, |
| | | }, |
| | | useScrollEndMounted(onScrollEnd, onNotScrollEnd) { |
| | | Vue.onMounted(function () { |
| | | window.addEventListener("scroll", function (ev) { |
| | | scrollTop.value = |
| | | document.documentElement.scrollTop || document.body.scrollTop; |
| | | if (SpaUtils.isScrollEnd(this, "vertical", 40)) { |
| | | onScrollEnd && onScrollEnd(); |
| | | } else { |
| | | onNotScrollEnd && onNotScrollEnd(); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | backTop() { |
| | | $("html,body").animate({ scrollTop: 0 }); |
| | | }, |
| | | onScrollEnd() { |
| | | this.getListData(); |
| | | }, |
| | | handleShare() { |
| | | SpaUtils.copy(location.href, "å¤å¶æåï¼å享ç»èº«è¾¹å¥½åå§~"); |
| | | }, |
| | | resetListData(isCleanList = true) { |
| | | Object.assign( |
| | | listData, |
| | | JSON.parse(listDataStr), |
| | | isCleanList ? undefined : { list: listData.list } |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | } |
| | | const Category = { |
| | | template: "#category", |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | required: true, |
| | | }, |
| | | value: { |
| | | type: [String, Number], |
| | | required: true, |
| | | }, |
| | | valueKey: { |
| | | type: String, |
| | | default: "value", |
| | | }, |
| | | labelKey: { |
| | | type: String, |
| | | default: "label", |
| | | }, |
| | | urlParamKey: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }, |
| | | emits: ["change", "update:value"], |
| | | setup(props, ctx) { |
| | | const propsRefs = Vue.toRefs(props); |
| | | const data = { |
| | | allCateVisible: Vue.ref(false), |
| | | activeValue: Vue.ref(""), |
| | | cateAllRef: Vue.ref(), |
| | | }; |
| | | const methods = { |
| | | onTabChange() { |
| | | methods.closeAll(); |
| | | Vue.nextTick(() => { |
| | | if (data.activeValue.value === props.value) return; |
| | | methods.emit(data.activeValue.value); |
| | | }); |
| | | }, |
| | | emit(value) { |
| | | if (props.urlParamKey) { |
| | | SpaUtils.historyReplaceState({ |
| | | [props.urlParamKey]: data.activeValue.value, |
| | | }); |
| | | } |
| | | ctx.emit("update:value", value); |
| | | ctx.emit("change", value); |
| | | }, |
| | | onCateChange(item) { |
| | | methods.closeAll(); |
| | | const value = item[props.valueKey]; |
| | | data.activeValue.value = value; |
| | | methods.emit(value); |
| | | }, |
| | | isHideAll() { |
| | | return ( |
| | | data.cateAllRef.value.getAttribute("toggle-status") === "hide" |
| | | ); |
| | | }, |
| | | closeAll() { |
| | | data.allCateVisible.value = false; |
| | | !methods.isHideAll() && methods.toggleHeight(); |
| | | }, |
| | | showAll() { |
| | | data.allCateVisible.value = true; |
| | | methods.isHideAll() && methods.toggleHeight(); |
| | | }, |
| | | |
| | | toggleHeight() { |
| | | tsUtils.toggleWidthOrHeight(data.cateAllRef.value, "height", { |
| | | duration: "300ms", |
| | | }); |
| | | }, |
| | | toggleCateAllVisible() { |
| | | data.allCateVisible.value = !data.allCateVisible.value; |
| | | methods.toggleHeight(); |
| | | }, |
| | | }; |
| | | (function () { |
| | | Vue.onMounted(() => { |
| | | data.activeValue.value = props.value; |
| | | window.addEventListener("click", function () { |
| | | methods.closeAll(); |
| | | }); |
| | | }); |
| | | |
| | | Vue.watch( |
| | | propsRefs.value, |
| | | (n) => { |
| | | data.activeValue.value = n; |
| | | }, |
| | | { immediate: true } |
| | | ); |
| | | })(); |
| | | return { ...data, ...methods }; |
| | | }, |
| | | }; |
| | | function getComponents() { |
| | | const Card = Vue.defineComponent({ |
| | | template: "#c-card", |
| | | props: { |
| | | item: Object, |
| | | }, |
| | | emits: ["transfer"], |
| | | setup(props, ctx) { |
| | | return { |
| | | buy(e, type = "buy") { |
| | | ctx.emit("transfer", { e, item: props.item, type }); |
| | | }, |
| | | getMoneyStr: SpaUtils.numWan, |
| | | }; |
| | | }, |
| | | }); |
| | | const Share = Vue.defineComponent({ |
| | | template: "#c-share", |
| | | emits: ["show-directer"], |
| | | setup(props, ctx) { |
| | | return { |
| | | handleShare() { |
| | | ctx.emit("share"); |
| | | }, |
| | | showDirecter() { |
| | | ctx.emit("show-directer"); |
| | | }, |
| | | }; |
| | | }, |
| | | }); |
| | | return { card: Card, share: Share, category: Category }; |
| | | } |
| | | </script> |
| | | <script> |
| | | window.onload = function () { |
| | | const stamp = Date.now() - (Date.now() % (60 * 1000 * 30)); |
| | | const app = Vue.createApp({ |
| | | name: "App", |
| | | directives: { |
| | | movable: SpaUtils.movable, |
| | | }, |
| | | components: getComponents(), |
| | | setup() { |
| | | const cateKey = "ds_cate_id"; |
| | | const { |
| | | data: baseData, |
| | | methods: baseMethods, |
| | | useScrollEndMounted, |
| | | } = useBase(); |
| | | const customParams = useCustomParams(); |
| | | const data = { |
| | | ...baseData, |
| | | cateKey, |
| | | banner: "https://img.bc.haodanku.com/cms/1666341435?t=" + stamp, |
| | | top: 0, |
| | | loading: Vue.ref(true), |
| | | refreshing: Vue.ref(false), |
| | | isScrollToDown: Vue.ref(false), |
| | | searchValue: Vue.ref(""), |
| | | category: Vue.reactive({ |
| | | list: [], |
| | | value: SpaUtils.parseSearch()[cateKey] || "", |
| | | }), |
| | | fromLink: decodeURIComponent(SpaUtils.parseSearch().from || ""), |
| | | ...customParams, |
| | | }; |
| | | const methods = { |
| | | ...baseMethods, |
| | | backTop() { |
| | | $("html,body").animate({ scrollTop: 0 }); |
| | | }, |
| | | backTopAndReGetListData() { |
| | | methods.resetListData(false); |
| | | methods.backTop(); |
| | | return methods.getListData(true); |
| | | }, |
| | | reGetListData() { |
| | | methods.resetListData(false); |
| | | return methods.getListData(true); |
| | | }, |
| | | onSearch() { |
| | | // å°é»è®¤éæ©ç¬¬ä¸ä¸ªåç±» |
| | | if (data.category.list.length > 0) { |
| | | data.category.value = data.category.list[0].cat_id; |
| | | } |
| | | methods.backTopAndReGetListData(); |
| | | }, |
| | | onSearchClear() { |
| | | data.searchValue.value = ""; |
| | | methods.backTopAndReGetListData(); |
| | | }, |
| | | onCateChange() { |
| | | // æ¸
空æç´¢æ |
| | | data.searchValue.value = "" |
| | | SpaUtils.historyReplaceState({ |
| | | [cateKey]: data.category.value, |
| | | }); |
| | | methods.backTopAndReGetListData(); |
| | | }, |
| | | async getCategory() { |
| | | const url = "https://v2.api.haodanku.com/category_list"; |
| | | const res = await SpaUtils.Request.get(url, { |
| | | type: 13, |
| | | is_has: 1, |
| | | }).promise; |
| | | const cateIdKey = "cat_id"; |
| | | const cateList = res.data || []; |
| | | if (!cateList.length) return; |
| | | cateList.forEach((i) => (i[cateIdKey] = String(i[cateIdKey]))); |
| | | const firstId = cateList[0][cateIdKey]; |
| | | let cate = SpaUtils.parseSearch()[cateKey] || firstId; |
| | | const find = cateList.find((i) => cate === i[cateIdKey]); |
| | | if (!find) { |
| | | cate = firstId; |
| | | SpaUtils.historyReplaceState({ [cateKey]: cate }); |
| | | } |
| | | data.loading.value = false; |
| | | data.category.list = cateList; |
| | | data.category.value = cate; |
| | | methods.reGetListData(); |
| | | }, |
| | | async getListData(clean) { |
| | | const loading = data.loading; |
| | | const listData = data.listData; |
| | | if (loading.value || listData.loading || listData.finished) |
| | | return; |
| | | listData.loading = true; |
| | | if (clean) { |
| | | loading.value = true; |
| | | } |
| | | try { |
| | | const min_size = 10; |
| | | const param = { |
| | | ...customParams.getListDataParams(), |
| | | keyword: data.searchValue.value, |
| | | cate_id: data.category.value, |
| | | min_id: data.listData.min_id, |
| | | back: min_size, |
| | | }; |
| | | const url = |
| | | "https://v3.api.haodanku.com/dy_onebuy"; |
| | | const res = await SpaUtils.Request.get(url, param).promise; |
| | | const list = res.data || []; |
| | | |
| | | setTimeout(() => { |
| | | listData.list = clean ? list : listData.list.concat(list); |
| | | listData.finished = |
| | | listData.min_id == res.min_id || |
| | | !list.length || |
| | | list.length < min_size; |
| | | listData.min_id = res.min_id || listData.min_id; |
| | | }, 200); |
| | | return res; |
| | | } catch (e) { |
| | | listData.list = []; |
| | | listData.finished = true; |
| | | } finally { |
| | | setTimeout(() => { |
| | | listData.loading = false; |
| | | loading.value = false; |
| | | data.refreshing.value = false; |
| | | }, 200); |
| | | } |
| | | }, |
| | | /** |
| | | * ååè½¬é¾ |
| | | * @param e {MouseEvent} |
| | | * @param item |
| | | */ |
| | | async handleGoodsTransfer({ e, item }) { |
| | | const param = { |
| | | itemid: item.product_id, |
| | | ...customParams.getTransferParams(), |
| | | }; |
| | | |
| | | try { |
| | | const params = { |
| | | // sync: true, |
| | | platformType: "dy", |
| | | itemData: item, |
| | | url: "https://v2.api.haodanku.com/get_dyitem_link", |
| | | el: e.target, |
| | | data: param, |
| | | copySuccessMsg: "å¤å¶æå£ä»¤æå,请æå¼æé³APPä¸å", |
| | | getCopyTarget(res) { |
| | | return res.data.dy_password; |
| | | }, |
| | | }; |
| | | await SpaUtils.conversionLink(params); |
| | | } catch (e) { |
| | | SpaUtils.toast(e.msg || "转é¾å¤±è´¥"); |
| | | } |
| | | }, |
| | | }; |
| | | |
| | | function init() { |
| | | methods.getCategory(); |
| | | useScrollEndMounted(); |
| | | Vue.watch(baseData.scrollTop, (n, o) => { |
| | | data.isScrollToDown.value = n > o; |
| | | }); |
| | | } |
| | | |
| | | init(); |
| | | return { ...data, ...methods }; |
| | | }, |
| | | }); |
| | | app.use(vant); |
| | | app.use(vant.Lazyload, { |
| | | lazyComponent: true, |
| | | preLoad: 1.3, |
| | | error: "http://img.bc.haodanku.com/haodanku/1595237918", |
| | | loading: |
| | | "http://img.bc.fqapps.com/fudai13cae4ae6ef16739ed3b100a2ec39e97.gif", |
| | | attempt: 1, |
| | | }); |
| | | app.mount("#single-page-app"); |
| | | }; |
| | | </script> |
| | | <script> |
| | | function useCustomParams() { |
| | | const customParams = { |
| | | apikey: "0F92EBA7AADA", //å¿
å¡« |
| | | channel: "", //éå¡« |
| | | }; |
| | | return { |
| | | customParams, |
| | | // è·ååè¡¨æ°æ®åæ° |
| | | getListDataParams() { |
| | | return { apikey: customParams.apikey }; |
| | | }, |
| | | // 转é¾åæ° |
| | | getTransferParams(item) { |
| | | return { ...customParams }; |
| | | }, |
| | | }; |
| | | } |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-CN"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"> |
| | | <meta name="screen-orientation" content="portrait"> |
| | | <meta name="x5-orientation" content="portrait"> |
| | | <meta name="full-screen" content="yes"> |
| | | <meta name="x5-fullscreen" content="true"> |
| | | <meta name="browsermode" content="application"> |
| | | <meta name="x5-page-mode" content="app"> |
| | | <meta name="msapplication-tap-highlight" content="no"> |
| | | <meta content="telephone=no" name="format-detection"> |
| | | <title>红å
ç¹ä»·ä¸åº</title> |
| | | <link rel="stylesheet" href="//at.alicdn.com/t/font_1534407_5zmyvxx3vxs.css"> |
| | | <script type="text/javascript" src="https://img.ushopvip.com/js/uni-webview-js.js"></script> |
| | | <script> |
| | | document.write("<link rel=\"stylesheet\" href=\"https://img.bc.haodanku.com/cms/signin.css?t=" + (Date.now() - Date.now() % (60 * 1000 * 30)) + "\"/>"); |
| | | </script> |
| | | </head> |
| | | |
| | | <body> |
| | | <div id="app" v-cloak> |
| | | <template v-if="isexplain && issource"> |
| | | <div class="main"> |
| | | <!--<div class="banenr" v-on:click="openDirect"> |
| | | <img src="http://img.bc.haodanku.com/cms/1627984833" alt=""> |
| | | </div>--> |
| | | <div class="step"> |
| | | <img src="https://img.bc.haodanku.com/cms/1629341253" alt=""> |
| | | <div class="step-content"> |
| | | <div class="title">ç©æ³æ¦åµ</div> |
| | | <ul> |
| | | <li v-for="(item,index) in help_info"> |
| | | <span class="top-num">{{index + 1}}</span> |
| | | <span class="text">{{item}}</span> |
| | | </li> |
| | | </ul> |
| | | <div class="btn-block"> |
| | | <div class="btn to-sign-in" v-on:click="toSignIn"><span>åå¾ç¾å°</span> <i class="iconfont hdk-xiangyou"></i> |
| | | </div> |
| | | <div class="btn view-direct" v-on:click="openDirect"><span>æ¥ç徿æç¨</span> <i |
| | | class="iconfont hdk-xiangyou"></i></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="list-wrapper"> |
| | | <!--<h6>ç¾å°çº¢å
æµæ£ä¸åº</h6>--> |
| | | |
| | | <div class="newtop"> |
| | | <div class="search"> |
| | | <div class="search-box"> |
| | | <i class="search-icon"></i> |
| | | <input type="text" v-model="keyword" v-on:blur="myblur" v-on:focus="myfocus" |
| | | v-on:keyup.enter="handleSearch" |
| | | placeholder="è¾å
¥åååç§°"> |
| | | </div> |
| | | <span class="search-btn" v-on:click="handleSearch">æç´¢</span> |
| | | </div> |
| | | <div class="sort"> |
| | | <ul class="sort-list"> |
| | | <li v-for="item in fristOrderSort" v-bind:class="{'sort-active': item.number == sortNumber}" |
| | | v-on:click="handleSort(item)"> |
| | | {{ item.name }} |
| | | <span v-show="item.min !== item.max"> |
| | | <i v-bind:class="{'arrow-active': item.min == sortId}"></i> |
| | | <i v-bind:class="{'arrow-active': item.max == sortId}"></i> |
| | | </span> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | |
| | | <ul class="shoplist" v-if="fristOrderItems.length>0"> |
| | | <li v-for="(item,index) in fristOrderItems"> |
| | | <img class="shop-img" v-lazy="item.itempic" v-if="item.itempic"> |
| | | <img class="shop-img" src="http://img.bc.haodanku.com/haodanku-activity/1596092443" v-else> |
| | | <div class="shop-box" v-bind:class="!item.couponurl?'active':''"> |
| | | <p class="shop-title">{{item.itemshorttitle}}</p> |
| | | <div class="shop-tips"> |
| | | <img src="http://img.bc.haodanku.com/haodanku/1613978202"> |
| | | <p>é¢åç¾å°çº¢å
å¯åå å æµæ£ï¼</p> |
| | | </div> |
| | | <div class="shop-tips row-2"> |
| | | <img src="http://img.bc.haodanku.com/cms/1627703910"> |
| | | <p>åºéºï¼{{item.shopname}}</p> |
| | | </div> |
| | | <div class="ticket" v-if="item.couponurl"><span class="name">å¸</span><span |
| | | class="value">ï¿¥{{item.couponmoney}}</span></div> |
| | | <div class="shop-b"> |
| | | <div class="shop-b-l"> |
| | | <p class="shop-b-m"><i>å¸åä»·</i>ï¿¥{{parseFloat(item.itemendprice)}}</p> |
| | | <p class="shop-b-label">ï¿¥{{parseFloat(item.itemprice)}}</p> |
| | | </div> |
| | | </div> |
| | | |
| | | <span class="shop-btn shop-coupon" v-on:click="getTaocode(item,true)" v-if="item.couponurl">ç«å³é¢å¸</span> |
| | | <span class="shop-btn" v-on:click="getTaocode(item)">æç´¢ä¸å</span> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | <div class="combox"> |
| | | <p class="realpic-loading" v-if="loadshow"><i class="vmIconLoad"></i><em>æ°æ®å è½½ä¸...</em></p> |
| | | <p class="realpic-loading" v-else>æ°æ®å·²å è½½å®äº</p> |
| | | </div> |
| | | </div> |
| | | <div class="free-share" v-bind:class="acFocus?'active':''"> |
| | | <img src="http://img.bc.haodanku.com/haodanku/1613981706" v-on:click="copyShare()" class="share-btn"> |
| | | </div> |
| | | <div> |
| | | <div class="back_top" v-if="scrollShow" v-on:click="arrowTop()"></div> |
| | | <div class="tokenbox tokenbox1"> |
| | | <em class="shut" v-on:click="shutBtn"></em> |
| | | <span>{{taoToken}}</span> |
| | | <p>å¤å¶æ·å£ä»¤ï¼æå¼ææºæ·å®é¢å</p> |
| | | <span class="copybtn" v-on:click="copyBtn('.copybtn')">å¤å¶æ·å£ä»¤</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <div v-if="!isexplain"> |
| | | <img src="http://img.bc.haodanku.com/haodanku-activity/1596022875" class="goback" |
| | | v-on:click="arrowBtn('isexplain')"> |
| | | <img src="http://img.bc.haodanku.com/haodanku_activity/1596768292"> |
| | | </div> |
| | | |
| | | <div v-if="!issource"> |
| | | <img src="http://img.bc.haodanku.com/haodanku-activity/1596022875" class="goback" |
| | | v-on:click="arrowBtn('issource')"> |
| | | <img src="http://img.bc.haodanku.com/haodanku-activity/1596032111" alt=""> |
| | | </div> |
| | | |
| | | <div class="direct-img" v-show="showDirect" v-on:click="closeDirect"> |
| | | <div class="direct-box"> |
| | | <div class="box-header"> |
| | | ä½¿ç¨æç¨ |
| | | <img |
| | | v-on:click="closeDirect" |
| | | class="btn-close" |
| | | src="http://img-haodanku-com.cdn.fudaiapp.com/FsHmpTJUJxhdJ7X8YL36ix1GduZg" |
| | | alt=""> |
| | | </div> |
| | | <div class="box-content"> |
| | | <img src="http://img.bc.haodanku.com/cms/1627703471?t=1" alt=""> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <transition name="fade"> |
| | | <div class="snapped-up" v-show="snappedUp.show"> |
| | | <div class="box"> |
| | | <div class="box-header"> |
| | | <img |
| | | class="btn-close" |
| | | v-on:click="closeSnappedUpDialog" |
| | | src="http://img.bc.haodanku.com/haodanku/1596096751" |
| | | alt=""> |
| | | </div> |
| | | <div class="box-content"> |
| | | <div class="title"> |
| | | å¤å¶ãä¸å龿¥ãæå¼ææ·APPï¼<br> |
| | | æç´¢ç«å³ä¸å ~ |
| | | </div> |
| | | <img src="http://img.bc.haodanku.com/cms/1627701410" alt=""> |
| | | <button class="btn copy" v-on:click="copyBtn('.copy.btn')">ç¹å»å¤å¶</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </transition> |
| | | <van-overlay :show="titleCopyTipsVisible" @click="titleCopyTipsVisible = false"> |
| | | <div |
| | | class="wrapper" |
| | | style="display:flex;align-items:center;justify-content:center;height: 100%;" |
| | | > |
| | | <img style="width: 6rem;" src="http://img-haodanku-com.cdn.fudaiapp.com/FhYQl6NqvQIycYZS1DM9DLBELA72" alt=""> |
| | | </div> |
| | | </van-overlay> |
| | | </div> |
| | | <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/vue/2.6.10/vue.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/vue-lazyload/1.3.3/vue-lazyload.js"></script> |
| | | <script src="https://cdn.bootcdn.net/ajax/libs/layer/2.3/layer.js"></script> |
| | | <script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script> |
| | | <script src="https://cdn.bootcdn.net/ajax/libs/ScrollToFixed/1.0.8/jquery-scrolltofixed-min.js"></script> |
| | | <script src="https://cdn.bootcdn.net/ajax/libs/device.js/0.2.7/device.min.js"></script> |
| | | <script src="https://img.bc.haodanku.com/cms/SpaUtils.min.js"></script> |
| | | <script src="https://cdn.staticfile.org/vant/2.12.5/vant.min.js"></script> |
| | | <link href="https://cdn.staticfile.org/vant/2.12.5/index.min.css" rel="stylesheet"> |
| | | <script src="https://img.bc.haodanku.com/cdn/vant-touch-emulator.js"></script> |
| | | <script> |
| | | var vmUrlSearchs = null; |
| | | |
| | | function vmRequest(name) { |
| | | if(!vmUrlSearchs) { |
| | | vmUrlSearchs = new vmUrlSearch(); |
| | | } |
| | | return vmUrlSearchs[name]; |
| | | } |
| | | |
| | | function vmUrlSearch() { |
| | | var name, value; |
| | | var str = location.href; |
| | | var num = str.indexOf("?"); |
| | | str = str.substr(num + 1); |
| | | var arr = str.split("&"); |
| | | for(var i = 0; i < arr.length; i++) { |
| | | if(num = arr[i].indexOf("=") != -1) { |
| | | num = arr[i].indexOf("="); |
| | | } else { |
| | | num = arr[i].indexOf("/"); |
| | | } |
| | | if(num > 0) { |
| | | name = arr[i].substring(0, num); |
| | | value = arr[i].substr(num + 1); |
| | | this[name] = value; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | Vue.use(VueLazyload, { |
| | | preLoad: 1.3, |
| | | error: "http://img.bc.haodanku.com/haodanku/1595237918", |
| | | loading: "http://img.bc.haodanku.com/haodanku-activity/1596092443", |
| | | attempt: 1 |
| | | }); |
| | | var app = new Vue({ |
| | | el: "#app", |
| | | data: function() { |
| | | return { |
| | | showDirect: false, |
| | | codeId: vmRequest("code"), |
| | | |
| | | fristOrderSort: [ |
| | | { |
| | | name: "综å", |
| | | bool: true, |
| | | max: "", |
| | | min: "", |
| | | number: 3 |
| | | }, |
| | | { |
| | | name: "ä»·æ ¼", |
| | | bool: false, |
| | | max: 3, |
| | | min: 1, |
| | | number: 0 |
| | | }, |
| | | { |
| | | name: "éé", |
| | | bool: false, |
| | | max: 2, |
| | | min: 2, |
| | | number: 1 |
| | | }, |
| | | { |
| | | name: "ææ°", |
| | | bool: false, |
| | | max: 5, |
| | | min: 5, |
| | | number: 2 |
| | | } |
| | | ], |
| | | sortId: "", |
| | | sortBool: true, |
| | | sortNumber: 3, |
| | | |
| | | fristOrderItems: [], |
| | | topArr: [], |
| | | |
| | | |
| | | page: 1, |
| | | loadmsg: true, |
| | | loadshow: true, |
| | | |
| | | scrollShow: false, |
| | | |
| | | taoToken: "", |
| | | |
| | | isexplain: true, |
| | | issource: true, |
| | | locationUrl: window.location.href, |
| | | |
| | | keyword: "", |
| | | |
| | | sigclick: false, |
| | | |
| | | playState: false, |
| | | vmHttp: window.location.protocol.substring(0, window.location.protocol.length - 1) != "file" ? window.location.protocol.substring(0, window.location.protocol.length - 1) : "https", |
| | | |
| | | acFocus: false, |
| | | outerHeight: "", |
| | | |
| | | // ç«å³æ¢è´å¼¹çªç¸å
³ |
| | | snappedUp: { |
| | | show: false, |
| | | code: "" |
| | | }, |
| | | |
| | | help_info: [], |
| | | |
| | | sign_info: {}, |
| | | titleCopyTipsVisible: false, |
| | | }; |
| | | }, |
| | | created: function() { |
| | | this.ajaxFristOrderItems(true); |
| | | }, |
| | | mounted: function() { |
| | | this.outerHeight = $(".banenr").outerHeight(true) + $(".secret-wrapper").outerHeight(true) + $(".list-wrapper>h6").outerHeight(true) + 2; |
| | | this.taobaoscroll(); |
| | | }, |
| | | methods: { |
| | | toSignIn: function() { |
| | | if(!this.sign_info.tpwd) { |
| | | return; |
| | | } |
| | | SpaUtils.copy(this.sign_info.tpwd, "å¤å¶å£ä»¤æåï¼è¯·æå¼æ·å®æµè§é¢åç¾å°çº¢å
"); |
| | | }, |
| | | arrowBtn: function(val) { |
| | | this[val] = !this[val]; |
| | | this.arrowTop(); |
| | | }, |
| | | taobaoscroll: function() { //æ»å¨å è½½ |
| | | var that = this; |
| | | window.addEventListener("scroll", function() { |
| | | |
| | | var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; |
| | | var clientHeight = document.documentElement.clientHeight || document.body.clientHeight; |
| | | var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight; |
| | | |
| | | if(!that.isexplain || !that.issource) return; |
| | | that.scrollShow = scrollTop > 750; |
| | | if(scrollHeight > clientHeight && scrollTop + clientHeight + 20 >= scrollHeight) { |
| | | if(that.loadmsg && !that.sigclick) { |
| | | that.loadmsg = false; |
| | | that.sigclick = false; |
| | | that.ajaxFristOrderItems(); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | ajaxFristOrderItems: function(cb) { |
| | | var that = this; |
| | | if(that.sigclick) { |
| | | if(this.fristOrderItems[0]) { |
| | | this.fristOrderItems.forEach(function(item) { |
| | | item.itempic = ""; |
| | | }); |
| | | } |
| | | document.documentElement.scrollTop = that.outerHeight; |
| | | document.body.scrollTop = that.outerHeight; |
| | | } |
| | | $.ajax({ |
| | | type: "Get", |
| | | url: that.vmHttp + "://v2.api.haodanku.com/sign_red_pack_goods", |
| | | data: { |
| | | apikey: '', //å¿
å¡« |
| | | min_size: 20, |
| | | sort: that.sortId, |
| | | min_id: that.page, |
| | | keyword: that.keyword, |
| | | pure_tpwd: vmRequest("pure_tpwd") ? 1 : undefined |
| | | }, |
| | | dataType: "json", |
| | | timeout: 5000, |
| | | success: function(data) { |
| | | if(data.code == "200") { |
| | | that.help_info = data.help_info || []; |
| | | that.sign_info = data.sign_info || {}; |
| | | if(that.sigclick) { |
| | | that.fristOrderItems = data.data; |
| | | } else { |
| | | that.fristOrderItems = that.fristOrderItems.concat(data.data); |
| | | } |
| | | that.topArr = data.top_data; |
| | | if(that.page != data.min_id) { |
| | | that.loadmsg = true; |
| | | that.loadshow = true; |
| | | that.page = data.min_id; |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | } |
| | | that.$nextTick(function() { |
| | | that.sigclick = false; |
| | | if(cb) { |
| | | $(".newtop").scrollToFixed(); |
| | | } |
| | | |
| | | }); |
| | | } else { |
| | | that.loadmsg = false; |
| | | that.loadshow = false; |
| | | that.sigclick = false; |
| | | layer.msg(data.msg, { |
| | | time: 2000, |
| | | shade: 0.1, |
| | | shadeClose: true |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | error: function() { |
| | | that.msgFun("ç½ç»é误ï¼è¯·æ£æ¥ç½ç»éè¯"); |
| | | } |
| | | }); |
| | | }, |
| | | handleSort: function(item) { |
| | | if(this.sortNumber == item.number) { |
| | | if(item.min === item.max) { |
| | | return; |
| | | } |
| | | if(item.bool) { |
| | | this.sortId = item.min; |
| | | item.bool = false; |
| | | } else { |
| | | this.sortId = item.max; |
| | | item.bool = true; |
| | | } |
| | | } else { |
| | | item.bool = true; |
| | | this.sortNumber = item.number; |
| | | this.sortId = item.max; |
| | | } |
| | | this.page = 1; |
| | | this.loadmsg = true; |
| | | this.loadshow = true; |
| | | this.sigclick = true; |
| | | this.ajaxFristOrderItems(); |
| | | }, |
| | | popupFun: function(classname) { |
| | | layer.open({ |
| | | type: 1, |
| | | shift: 0, |
| | | title: false, |
| | | closeBtn: 0, |
| | | shade: 0.4, |
| | | shadeClose: true, |
| | | content: $(classname) |
| | | }); |
| | | }, |
| | | getTaocode: function(item, isCoupon) { |
| | | // if(!isCoupon && vmRequest("pure_tpwd")) { |
| | | // // ç´æ¥å¤å¶ |
| | | // copy(item.tpwd, "å¤å¶å£ä»¤æå,请æå¼æ·å®ä¸å"); |
| | | if(!isCoupon) { |
| | | // ç´æ¥å¤å¶ |
| | | SpaUtils.copy(item.itemtitle, false); |
| | | this.titleCopyTipsVisible = true; |
| | | return; |
| | | } |
| | | var that = this; |
| | | var load = layer.load(1, {shade: 0.3}); |
| | | $.ajax({ |
| | | type: "Post", |
| | | url: that.vmHttp + "://v2.api.haodanku.com/ratesurl", |
| | | data: { |
| | | apikey: '0F92EBA7AADA', //å¿
å¡« |
| | | itemid: item.itemid, |
| | | activityid: isCoupon ? item.activityid : undefined, |
| | | title: item.itemshorttitle, |
| | | itemtitle: item.itemtitle, |
| | | pid: 'mm_4091757048_2861600076_114781900494', //å¿
å¡« |
| | | tb_name: 'tb108547775155', //å¿
å¡« |
| | | get_taoword: 1, |
| | | }, |
| | | dataType: "json", |
| | | timeout: 5000, |
| | | success: function(data) { |
| | | layer.close(load); |
| | | if(data.code == "1") { |
| | | that.taoToken = data.data.taoword; |
| | | if(isCoupon) { |
| | | that.popupFun(".tokenbox1"); |
| | | } else { |
| | | that.openSnappedUpDialog(); |
| | | } |
| | | } else { |
| | | that.msgFun(data.msg); |
| | | } |
| | | |
| | | }, |
| | | error: function() { |
| | | layer.close(load); |
| | | that.msgFun("ç½ç»é误ï¼è¯·æ£æ¥ç½ç»éè¯"); |
| | | } |
| | | }); |
| | | }, |
| | | msgFun: function(val) { |
| | | layer.msg(val, { |
| | | time: 2000, |
| | | shade: 0.1, |
| | | shadeClose: true |
| | | }); |
| | | }, |
| | | arrowTop: function() { |
| | | $("body,html").stop(true, true).animate({ |
| | | scrollTop: 0 |
| | | }); |
| | | }, |
| | | copyBtn: function(dom) { //å¤å¶å
Œ
±æ¹æ³ |
| | | var that = this; |
| | | var clipboard = new ClipboardJS(dom, { |
| | | text: function(target) { |
| | | return that.taoToken; |
| | | } |
| | | }); |
| | | clipboard.on("success", function(e) { |
| | | layer.closeAll(); |
| | | that.msgFun(that.snappedUp.show ? "ä¸å龿¥å¤å¶æåï¼è¯·æå¼ææ·APPæç´¢ä¸å" : "å¤å¶å£ä»¤æå,请æå¼æ·å®é¢å"); |
| | | e.clearSelection(); |
| | | clipboard.destroy(); |
| | | }); |
| | | clipboard.on("error", function(e) { |
| | | layer.msg("å¤å¶å£ä»¤å¤±è´¥,请æå¨å¤å¶", { |
| | | shade: 0.4, |
| | | time: 1000, |
| | | shadeClose: false |
| | | }, function() { |
| | | }); |
| | | |
| | | }); |
| | | }, |
| | | copyShare: function() { //å¤å¶å
Œ
±æ¹æ³ |
| | | var that = this; |
| | | |
| | | var txt = that.locationUrl; |
| | | |
| | | var clipboard = new ClipboardJS(".share-btn", { |
| | | text: function(target) { |
| | | return txt; |
| | | } |
| | | }); |
| | | clipboard.on("success", function(e) { |
| | | that.msgFun("å·²å¤å¶åäº«é¾æ¥"); |
| | | console.log(txt); |
| | | e.clearSelection(); |
| | | clipboard.destroy(); |
| | | }); |
| | | clipboard.on("error", function(e) { |
| | | layer.msg("å¤å¶åäº«é¾æ¥å¤±è´¥ï¼", { |
| | | shade: 0.4, |
| | | time: 1000, |
| | | shadeClose: false |
| | | }, function() { |
| | | }); |
| | | |
| | | }); |
| | | }, |
| | | handleSearch: function() { |
| | | this.page = 1; |
| | | this.loadmsg = true; |
| | | this.loadshow = true; |
| | | this.sigclick = true; |
| | | this.ajaxFristOrderItems(); |
| | | }, |
| | | shutBtn: function() { |
| | | layer.closeAll(); |
| | | }, |
| | | playBtn: function() { |
| | | this.playState = true; |
| | | }, |
| | | myfocus: function() { |
| | | this.acFocus = true; |
| | | }, |
| | | myblur: function() { |
| | | this.acFocus = false; |
| | | }, |
| | | openDirect: function() { |
| | | this.showDirect = true; |
| | | }, |
| | | closeDirect: function() { |
| | | this.showDirect = false; |
| | | }, |
| | | openSnappedUpDialog: function() { |
| | | this.snappedUp.show = true; |
| | | }, |
| | | closeSnappedUpDialog: function() { |
| | | this.snappedUp.show = false; |
| | | } |
| | | }, |
| | | watch: {} |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |