app-diy-page.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <view class="app-diy-page" :class="mp_link_top ? 'mp_link_top' : ''">
  3. <view class="nav-bar dir-left-nowrap" :class="mp_link_top ? 'mp_link_top' : ''" v-if="newData.show_navs == 1">
  4. <block v-for="(nav, index) in newData.navs" :key="index">
  5. <view class="nav-bar-one cross-center box-grow-0"
  6. :class="nav_active === index ? 'active' : ''"
  7. @click='changeNav(index)'
  8. >
  9. {{nav.name}}
  10. </view>
  11. </block>
  12. </view>
  13. <view class="diy-template">
  14. <block v-for="(nav, index) in newData.navs" :key="index">
  15. <template v-if="index === nav_active">
  16. <block v-for="(temp, temp_index) in nav.template.data" :key="temp_index">
  17. <view v-if="temp.id === 'background'"
  18. class="app-diy-bg"
  19. :style="[{'background-color':`${temp.data.backgroundColor}`,
  20. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  21. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  22. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  23. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  24. ></view>
  25. <template v-if="temp.id === 'search'">
  26. <view>
  27. <app-search-for :value="temp.data"></app-search-for>
  28. </view>
  29. </template>
  30. <template v-else-if="temp.id === 'banner'">
  31. <view v-if="temp.data.banners.length > 0">
  32. <app-swiper :swiperType="temp.data.style == 2 ? true : false"
  33. :swiperHeight="temp.data.height"
  34. :swiperList="temp.data.banners"
  35. :mode="temp.data.fill == 1 ? 'scaleToFill' : 'aspectFit'"
  36. imageKey="pic_url"
  37. ></app-swiper>
  38. </view>
  39. </template>
  40. <template v-else-if="temp.id === 'notice'">
  41. <view>
  42. <app-announcement :background="temp.data.background"
  43. :btn-color="temp.data.btnColor"
  44. :btn-height="temp.data.btnHeight"
  45. :btn-radius="`${temp.data.btnRadius}rpx`"
  46. :btn-text="temp.data.btnText"
  47. :btn-text-color="temp.data.btnTextColor"
  48. :btn-width="temp.data.btnWidth"
  49. :content="temp.data.content"
  50. :header-url="temp.data.headerUrl"
  51. :icon="temp.data.icon"
  52. :name="temp.data.name"
  53. :textColor="temp.data.textColor"
  54. ></app-announcement>
  55. </view>
  56. </template>
  57. <template v-else-if="temp.id === 'nav'">
  58. <view :style="[{'background-color':`${temp.data.backgroundColor}`,
  59. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  60. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  61. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  62. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]">
  63. <app-navigation-icon :background="''" :color="temp.data.color"
  64. :rows="temp.data.rows" :columns="temp.data.columns"
  65. :scroll="temp.data.scroll"
  66. :navs="temp.data.navs"></app-navigation-icon>
  67. </view>
  68. </template>
  69. <template v-else-if="temp.id === 'video'">
  70. <view>
  71. <app-video :pic-url="temp.data.pic_url"
  72. :url="temp.data.url"
  73. ></app-video>
  74. </view>
  75. </template>
  76. <template v-else-if="temp.id === 'link'">
  77. <view>
  78. <app-associated-link :arrows-switch="temp.data.arrowsSwitch"
  79. :background="temp.data.background" :color="temp.data.color"
  80. :position="temp.data.position" :style-color="temp.data.styleColor"
  81. :link="temp.data.link" :styleNum="temp.data.style"
  82. :pic-switch="temp.data.picSwitch" :pic-url="temp.data.picUrl"
  83. :font-size="temp.data.fontSize"
  84. :title="temp.data.title"></app-associated-link>
  85. </view>
  86. </template>
  87. <template v-else-if="temp.id === 'topic'">
  88. <view v-if="temp.data.style === 'normal'">
  89. <app-special-topic :count="temp.data.count" :icon="temp.data.icon"
  90. :logo_1="temp.data.logo_1" :logo_2="temp.data.logo_2"
  91. :topic_list="temp.data.topic_list"></app-special-topic>
  92. </view>
  93. <view v-if="temp.data.style === 'list'">
  94. <app-special-topic-list :cat-show="temp.data.cat_show" :list="temp.data.list"
  95. :topic-list="temp.data.topic_list"></app-special-topic-list>
  96. </view>
  97. </template>
  98. <template v-else-if="temp.id === 'rubik'">
  99. <view style="position: relative">
  100. <app-image-ad :image-style="temp.data.style" :list="temp.data.list"
  101. :height="temp.data.height"></app-image-ad>
  102. <block v-for="(hotspot, hotspot_index) in temp.data.hotspot" :key="hotspot_index">
  103. <app-hotspot :hotspot="rubikHotspot(hotspot)"></app-hotspot>
  104. </block>
  105. </view>
  106. </template>
  107. <template v-else-if="temp.id === 'store'">
  108. <view>
  109. <app-shop :list="temp.data.list" :nav-pic-url="temp.data.navPicUrl"
  110. :score-pic-url="temp.data.scorePicUrl" :show-name="temp.data.showName"
  111. :show-score="temp.data.showScore" :show-tel="temp.data.showTel"
  112. :scrollTop="scrollTop"></app-shop>
  113. </view>
  114. </template>
  115. <template v-else-if="temp.id === 'copyright'">
  116. <view>
  117. <app-copyright :background-color="temp.data.backgroundColor" :text="temp.data.text"
  118. :pic-url="temp.data.picUrl" :link="temp.data.link"></app-copyright>
  119. </view>
  120. </template>
  121. <template v-else-if="temp.id === 'user-info'">
  122. <view>
  123. <app-user-center :top-pic-url="temp.data.backgroundPicUrl"
  124. :member-pic-url="userCenter.member_pic_url"
  125. :top-style="temp.data.style"></app-user-center>
  126. </view>
  127. </template>
  128. <template v-else-if="temp.id === 'user-order'">
  129. <view>
  130. <app-my-order :order_bar="temp.data.navs"
  131. :background-color="temp.data.backgroundColor"></app-my-order>
  132. </view>
  133. </template>
  134. <template v-else-if="temp.id === 'goods'">
  135. <view v-if="temp.data.catPosition === 'top'"
  136. :style="[{'background-color':`${temp.data.backgroundColor}`,
  137. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  138. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  139. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  140. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]">
  141. <app-diy-goods-list :show-cat="temp.data.showCat"
  142. :show-buy-btn="temp.data.showBuyBtn"
  143. :cat-style="temp.data.catStyle"
  144. :cat-list="temp.data.catList"
  145. :list="temp.data.list" :list-style="temp.data.listStyle"
  146. :goods-cover-proportion="temp.data.goodsCoverProportion"
  147. :fill="temp.data.fill" :goods-style="temp.data.goodsStyle"
  148. :show-goods-name="temp.data.showGoodsName" :text-style="temp.data.textStyle"
  149. :show-goods-price="temp.data.showGoodsPrice"
  150. :buy-btn="temp.data.buyBtn" :sign="temp.id"
  151. :buy-btn-style="temp.data.buyBtnStyle"
  152. :buy-btn-text="temp.data.buyBtnText"
  153. :button-color="temp.data.buttonColor"
  154. :show-goods-tag="temp.data.showGoodsTag"
  155. :customize-goods-tag="temp.data.customizeGoodsTag"
  156. :goods-tag-pic-url="temp.data.goodsTagPicUrl"
  157. :cat-position="temp.data.catPosition"></app-diy-goods-list>
  158. </view>
  159. <view v-else :style="[{'background-color':`${temp.data.backgroundColor}`,
  160. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  161. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  162. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  163. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]">
  164. <app-recommended-product-list :show-cat="temp.data.showCat"
  165. :show-buy-btn="temp.data.showBuyBtn"
  166. :cat-style="temp.data.catStyle"
  167. :cat-list="temp.data.catList"
  168. :list="temp.data.list" :list-style="temp.data.listStyle"
  169. :goods-cover-proportion="temp.data.goodsCoverProportion"
  170. :fill="temp.data.fill" :goods-style="temp.data.goodsStyle"
  171. :show-goods-name="temp.data.showGoodsName"
  172. :show-goods-price="temp.data.showGoodsPrice"
  173. :buy-btn="temp.data.buyBtn" :sign="temp.id"
  174. :buy-btn-style="temp.data.buyBtnStyle"
  175. :buy-btn-text="temp.data.buyBtnText"
  176. :show-goods-tag="temp.data.showGoodsTag"
  177. :customize-goods-tag="temp.data.customizeGoodsTag"
  178. :goods-tag-pic-url="temp.data.goodsTagPicUrl"
  179. :button-color="temp.data.buttonColor"
  180. :cat-position="temp.data.catPosition"></app-recommended-product-list>
  181. </view>
  182. </template>
  183. <template v-else-if="temp.id === 'pintuan' || temp.id === 'miaosha' || temp.id === 'advance' || temp.id === 'booking' || temp.id === 'bargain' || temp.id === 'pick' || temp.id === 'lottery' || temp.id === 'integral-mall'">
  184. <!-- 插件商品列表 -->
  185. <view :style="[{'background-color':`${temp.data.backgroundColor}`,
  186. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  187. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  188. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  189. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]">
  190. <template v-if="temp.id === 'integral-mall' && temp.data.showCoupon">
  191. <view>
  192. <app-coupon :none-color="true" :coupon_list="temp.data.coupon_list" :sign="temp.id"
  193. :text-color="temp.data.couponColor" :show-top="false"
  194. :unclaimed-bg="temp.data.couponPicUrl"></app-coupon>
  195. </view>
  196. </template>
  197. <app-diy-goods-list
  198. :show-buy-btn="temp.data.showBuyBtn"
  199. :list="temp.data.list"
  200. :list-style="temp.data.listStyle"
  201. :goods-cover-proportion="temp.data.goodsCoverProportion"
  202. :fill="temp.data.fill"
  203. :goods-style="temp.data.goodsStyle"
  204. :show-goods-name="temp.data.showGoodsName"
  205. :text-style="temp.data.textStyle"
  206. buy-btn="text"
  207. :sign="temp.id"
  208. :button-color="temp.data.buttonColor"
  209. :buy-btn-style="temp.data.buyBtnStyle"
  210. :buy-btn-text="temp.data.buyBtnText"
  211. :show-goods-tag="temp.data.showGoodsTag"
  212. :page-hide="pageHide"
  213. :customize-goods-tag="temp.data.customizeGoodsTag"
  214. :goods-tag-pic-url="temp.data.goodsTagPicUrl"
  215. ></app-diy-goods-list>
  216. </view>
  217. </template>
  218. <!-- 优惠券 -->
  219. <template v-else-if="temp.id === 'coupon'">
  220. <view>
  221. <app-exclusive-coupon
  222. :background="temp.data.backgroundColor"
  223. :coupon_list="temp.data.coupon_list"
  224. :receive-bg="temp.data.receiveBg"
  225. :text-color="temp.data.textColor"
  226. :show-top="false"
  227. :unclaimed-bg="temp.data.unclaimedBg"
  228. ></app-exclusive-coupon>
  229. </view>
  230. </template>
  231. <template v-else-if="temp.id === 'timer'">
  232. <view>
  233. <app-diy-timer :pic-url="temp.data.picUrl" :start-date-time="temp.data.startDateTime"
  234. :end-date-time="temp.data.endDateTime" :page-hide="pageHide"
  235. :link="temp.data.link"></app-diy-timer>
  236. </view>
  237. </template>
  238. <template v-else-if="temp.id === 'mch'">
  239. <view :style="[{'background-color':`${temp.data.backgroundColor}`,
  240. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  241. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  242. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  243. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]">
  244. <app-goods-shop :card-style="temp.data.cardStyle" :background-color="temp.data.backgroundColor" type="diy" :list="temp.data.list"
  245. :show-goods="temp.data.showGoods"></app-goods-shop>
  246. </view>
  247. </template>
  248. <template v-else-if="temp.id === 'empty'">
  249. <view>
  250. <app-empty :height="temp.data.height"
  251. :background-color="temp.data.background"></app-empty>
  252. </view>
  253. </template>
  254. <template v-else-if="temp.id === 'ad'">
  255. <view>
  256. <app-ad :unit-id="temp.data.id"
  257. :type="temp.data.type"
  258. :coupon-url="coupon_url"
  259. :video-url="temp.data.video_url"
  260. :pic-url="temp.data.pic_url"
  261. :coupon-params="nav | getObje(temp)"
  262. ></app-ad>
  263. </view>
  264. </template>
  265. <template v-else-if="temp.id === 'modal'">
  266. <view>
  267. <app-popup-ad :opened="temp.data.opened" :times="temp.data.times" :list="temp.data.list"
  268. :multiple="true" :is_storage="is_storage"
  269. :mark="homePages.id + '-' + homePages.navs[nav_active].id + '-' + temp_index"></app-popup-ad>
  270. </view>
  271. </template>
  272. <template v-else-if="temp.id === 'quick-nav'">
  273. <view>
  274. <app-quick-navigation :value="temp.data" v-if="temp.data.navSwitch == 1"
  275. :use-mall-config="temp.data.useMallConfig"></app-quick-navigation>
  276. </view>
  277. </template>
  278. <!-- #ifdef MP-WEIXIN -->
  279. <template v-else-if="temp.id === 'mp-link'">
  280. <view :class="temp.data.position === 'top' ? `mp-link-top` : ``">
  281. <official-account @load="mpLink(temp.data.position)"
  282. @error="mpLinkError"></official-account>
  283. </view>
  284. </template>
  285. <!-- #endif -->
  286. <!-- #ifndef MP-TOUTIAO -->
  287. <template v-else-if="temp.id === 'map'">
  288. <app-map :background-pic-url="temp.data.backgroundPicUrl"
  289. :height="temp.data.height"
  290. :latitude="temp.data.latitude"
  291. :longitude="temp.data.longitude"
  292. :margin-top="temp.data.marginTop"
  293. :margin-top-color="temp.data.marginTopColor"
  294. :padding-x="temp.data.paddingX"
  295. :padding-y="temp.data.paddingY"
  296. ></app-map>
  297. </template>
  298. <!-- #endif -->
  299. <template v-else-if="temp.id === 'check-in'">
  300. <view>
  301. <app-check-in :background-pic-url="temp.data.backgroundPicUrl"
  302. :hotspot="temp.data.hotspot" :show-text="temp.data.showText"
  303. :text-color="temp.data.textColor"
  304. :text-position="temp.data.textPosition"></app-check-in>
  305. </view>
  306. </template>
  307. <template v-else-if="temp.id === 'image-text'">
  308. <view>
  309. <app-rich :content='temp.data.content'></app-rich>
  310. </view>
  311. </template>
  312. <template v-else-if="temp.id === 'form'">
  313. <view>
  314. <app-diy-form :title="temp.name"
  315. :list="temp.data.formDialog"
  316. :item-padding-x="temp.data.inputPadding"
  317. :item-margin-y="temp.data.marginBottom"
  318. :item-height="temp.data.height"
  319. :show-item-border="false"
  320. :label-position="transLabelPosition(temp.data.style)"
  321. :label-color="temp.data.inputLabel"
  322. label-text-align="left"
  323. :show-input-border="true"
  324. :input-background="temp.data.inputBackground"
  325. :input-border-color="temp.data.inputBorder"
  326. :input-text-color="temp.data.inputText"
  327. :input-placeholder-color="temp.data.inputTip"
  328. :input-radius="temp.data.radius"
  329. :show-submit="true"
  330. :submit-url="diyFormSubmitUrl"
  331. :submit-btn-text="temp.data.borderContent"
  332. :submit-btn-height="temp.data.buttonHeight"
  333. :submit-btn-padding="temp.data.buttonPadding"
  334. :submit-btn-margin="temp.data.buttonMargin"
  335. :submit-btn-radius="temp.data.buttonRadius"
  336. :submit-btn-background="temp.data.borderBackground"
  337. :submit-btn-border-color="temp.data.borderBorder"
  338. :submit-btn-text-color="temp.data.borderText"
  339. :background-color="temp.data.backgroundColor"
  340. :background-image="temp.data.backgroundPicUrl"
  341. :background-width="temp.data.backgroundWidth"
  342. :background-height="temp.data.backgroundHeight"
  343. :background-position="transLabelBackgroundPosition(temp.data.position)"
  344. :background-repeat="transLabelBackgroundRepeat(temp.data.mode)"
  345. :margin-top="temp.data.marginTop"
  346. :padding-top="temp.data.padding"
  347. :padding-bottom="temp.data.padding"
  348. ></app-diy-form>
  349. </view>
  350. </template>
  351. <template v-else-if="temp.id === 'notice'">
  352. <view>
  353. </view>
  354. </template>
  355. <template v-else-if="temp.id === 'vip-card'">
  356. <view>
  357. <app-vip-card :value="temp.data" top="0" :background="temp.data.background"></app-vip-card>
  358. </view>
  359. </template>
  360. <template v-else-if="temp.id === 'live'">
  361. <view>
  362. <app-live :value="temp.data"></app-live>
  363. </view>
  364. </template>
  365. </block>
  366. </template>
  367. </block>
  368. </view>
  369. </view>
  370. </template>
  371. <script>
  372. import {mapState} from 'vuex';
  373. import appSearchFor from '../../page-component/app-search-for/app-search-for.vue';
  374. import appSwiper from '../../page-component/app-swiper/swiper.vue';
  375. import appAnnouncement from '../../page-component/app-announcement/app-announcement.vue';
  376. import appNavigationIcon from '../../page-component/app-navigation-icon/app-navigation-icon.vue';
  377. import appVideo from '../../page-component/app-video/app-video.vue';
  378. import appAssociatedLink from '../../page-component/app-associated-link/app-associated-link.vue';
  379. import appSpecialTopic from '../../page-component/app-special-topic/app-special-topic-normal.vue';
  380. import appSpecialTopicList from '../../page-component/app-special-topic/app-special-topic-list.vue';
  381. import appImageAd from '../../page-component/app-image-ad/app-image-ad.vue';
  382. import appHotspot from '../../basic-component/app-hotspot/app-hotspot.vue';
  383. import appShop from '../../page-component/app-shop/app-shop.vue';
  384. import appCopyright from '../../page-component/app-copyright/app-copyright.vue';
  385. import appUserCenter from '../../page-component/app-user-center-top/app-user-center-top.vue';
  386. import appMyOrder from '../../page-component/app-my-order/app-my-order.vue';
  387. import appRecommendedProduct from '../../page-component/app-recommended-product/app-recommended-product.vue';
  388. import appRecommendedProductList from '../../page-component/app-recommended-product/app-recommended-product-list.vue';
  389. import appExclusiveCoupon from '../../page-component/app-exclusive-coupon/app-exclusive-coupon.vue';
  390. import appDiyTimer from '../../page-component/app-diy-timer/app-diy-timer.vue';
  391. import appGoodsShop from '../../page-component/app-good-shop-recommendation/app-good-shop-recommendation.vue';
  392. import appGroupGoods from '../../page-component/app-group-goods/app-group-goods.vue';
  393. import appEmpty from '../../basic-component/app-empty/app-empty.vue';
  394. import appPopupAd from '../../page-component/app-popup-ad/app-popup-ad.vue';
  395. import appQuickNavigation from '../../page-component/app-quick-navigation/app-quick-navigation.vue';
  396. import appCheckIn from '../../page-component/app-check-in/app-check-in.vue';
  397. import appRich from '../../basic-component/app-rich/parse.vue';
  398. import appReservation from "../../page-component/app-reservation/app-reservation.vue";
  399. import appSpike from "../../page-component/app-spike/app-spike.vue";
  400. import appDiyGoodsList from "../../page-component/app-diy-goods-list/app-diy-goods-list.vue";
  401. import appDiyForm from "../../page-component/app-diy-form/app-diy-form.vue";
  402. import appMap from "../../page-component/app-map/app-map.vue";
  403. import appVipCard from "../../page-component/app-vip-card/app-vip-card.vue";
  404. import appAd from "../../page-component/app-ad/app-ad";
  405. import appLive from "../../page-component/app-live/app-live.vue";
  406. export default {
  407. name: "app-diy-page",
  408. components: {
  409. 'app-search-for': appSearchFor,
  410. 'app-swiper': appSwiper,
  411. 'app-announcement': appAnnouncement,
  412. 'app-navigation-icon': appNavigationIcon,
  413. 'app-video': appVideo,
  414. 'app-associated-link': appAssociatedLink,
  415. 'app-special-topic': appSpecialTopic,
  416. 'app-special-topic-list': appSpecialTopicList,
  417. 'app-image-ad': appImageAd,
  418. 'app-hotspot': appHotspot,
  419. 'app-shop': appShop,
  420. 'app-copyright': appCopyright,
  421. 'app-user-center': appUserCenter,
  422. 'app-my-order': appMyOrder,
  423. 'app-recommended-product': appRecommendedProduct,
  424. 'app-recommended-product-list': appRecommendedProductList,
  425. 'app-exclusive-coupon': appExclusiveCoupon,
  426. 'app-diy-timer': appDiyTimer,
  427. 'app-goods-shop': appGoodsShop,
  428. 'app-group-goods': appGroupGoods,
  429. 'app-empty': appEmpty,
  430. 'app-popup-ad': appPopupAd,
  431. 'app-quick-navigation': appQuickNavigation,
  432. 'app-check-in': appCheckIn,
  433. 'app-rich': appRich,
  434. 'app-reservation': appReservation,
  435. 'app-spike': appSpike,
  436. 'app-diy-goods-list': appDiyGoodsList,
  437. 'app-diy-form': appDiyForm,
  438. 'app-vip-card': appVipCard,
  439. appMap,
  440. appAd,
  441. appLive,
  442. },
  443. props: {
  444. homePages: {
  445. type: Object,
  446. default() {
  447. return {};
  448. }
  449. },
  450. scrollTop: {
  451. type: Number,
  452. default() {
  453. return 0;
  454. }
  455. },
  456. is_storage: Boolean,
  457. pageHide: Boolean,
  458. },
  459. computed: {
  460. newData() {
  461. uni.setNavigationBarTitle({
  462. title: this.homePages.title,
  463. });
  464. console.log(this.homePages);
  465. for (let i = 0; i < this.homePages.navs.length; i++) {
  466. let navs = this.homePages.navs[i];
  467. for (let j = 0; j < navs.length; j++) {
  468. }
  469. }
  470. return this.homePages;
  471. },
  472. ...mapState({
  473. userCenter: state => state.mallConfig.user_center,
  474. }),
  475. diyFormSubmitUrl() {
  476. return this.$api.diy.page_store;
  477. },
  478. },
  479. data() {
  480. return {
  481. nav_active: 0,
  482. mp_link_top: false,
  483. coupon_url: this.$api.diy.receive,
  484. coupon_params: {}
  485. };
  486. },
  487. filters: {
  488. getObje(data, temp) {
  489. return {
  490. template_id: data.template_id
  491. }
  492. }
  493. },
  494. methods: {
  495. changeNav(index) {
  496. this.nav_active = index;
  497. this.mp_link_top = false;
  498. },
  499. rubikHotspot(hotspot) {
  500. if (hotspot && hotspot.link) {
  501. hotspot.link.url = hotspot.link.value;
  502. hotspot.link.openType = hotspot.link.open_type;
  503. }
  504. return hotspot;
  505. },
  506. mpLink(position) {
  507. if (position === 'top') {
  508. this.mp_link_top = true;
  509. }
  510. },
  511. transLabelPosition(val) {
  512. if (val == 3) {
  513. return 'top';
  514. }
  515. if (val == 2) {
  516. return 'inset';
  517. }
  518. return 'left';
  519. },
  520. transLabelBackgroundPosition(val) {
  521. if (val == 1) return 'left top';
  522. if (val == 2) return 'center top';
  523. if (val == 3) return 'right top';
  524. if (val == 4) return 'left center';
  525. if (val == 5) return 'center center';
  526. if (val == 6) return 'right center';
  527. if (val == 7) return 'left bottom';
  528. if (val == 8) return 'center bottom';
  529. if (val == 9) return 'right bottom';
  530. return 'center';
  531. },
  532. transLabelBackgroundRepeat(val) {
  533. if (val == 1) return 'no-repeat';
  534. if (val == 2) return 'repeat-x';
  535. if (val == 3) return 'repeat-y';
  536. if (val == 4) return 'repeat';
  537. return 'no-repeat';
  538. },
  539. mpLinkError() {
  540. this.mp_link_top = false;
  541. }
  542. }
  543. }
  544. </script>
  545. <style scoped lang="scss">
  546. .app-diy-bg {
  547. position: fixed;
  548. top: 0;
  549. left: 0;
  550. width: 100%;
  551. height: 100%;
  552. z-index: -1;
  553. }
  554. .app-diy-page {
  555. width: 100%;
  556. height: 100%;
  557. .nav-bar {
  558. position: fixed;
  559. left: 0;
  560. top: 0;
  561. z-index: 1500;
  562. background-color: #ffffff;
  563. width: 100%;
  564. height: #{44px};
  565. padding: 0 #{30rpx};
  566. overflow-x: auto;
  567. border-bottom: #{1rpx} solid #e2e2e2;
  568. .nav-bar-one {
  569. width: auto;
  570. margin-right: #{30rpx};
  571. padding: 0 #{15rpx};
  572. &.active {
  573. color: #ff4544;
  574. border-bottom: #{4rpx} solid #ff4544;
  575. }
  576. }
  577. &.mp_link_top {
  578. top: #{84px};
  579. }
  580. &.mp_link_top ~ .diy-template {
  581. margin-top: #{44px + 84px};
  582. }
  583. & ~ .diy-template {
  584. margin-top: #{44px};
  585. }
  586. }
  587. .mp-link-top {
  588. position: fixed;
  589. top: 0;
  590. left: 0;
  591. z-index: 1500;
  592. width: 100%;
  593. }
  594. &.mp_link_top {
  595. margin-top: #{168rpx};
  596. }
  597. }
  598. </style>