app-diy-page.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <view class="app-diy-page" v-bind:class="mp_link_top ? 'mp_link_top' : ''">
  3. <view class="nav-bar dir-left-nowrap" v-bind: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. v-bind:class="nav_active === index ? 'active ' + theme + '-m-text ' + theme : ''"
  7. v-on:click='changeNav(index)'
  8. >
  9. {{nav.name}}
  10. </view>
  11. </block>
  12. </view>
  13. <view class="diy-template">
  14. <block v-for="(item, index) in newData.navs" :key="index">
  15. <template v-if="nav_active === index">
  16. <block v-for="(temp, temp_index) in item.template.data" :key="temp_index">
  17. <template v-if="temp.id === 'background'">
  18. <view
  19. class="app-diy-bg"
  20. :style="[
  21. {'background-color':`${temp.data.backgroundColor}`,
  22. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  23. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  24. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  25. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}
  26. ]"
  27. ></view>
  28. </template>
  29. <!--搜索-->
  30. <template v-else-if="temp.id === 'search'">
  31. <app-search-for v-bind:value="temp.data"></app-search-for>
  32. </template>
  33. <!--轮播图-->
  34. <template v-else-if="temp.id === 'banner'">
  35. <template v-if="temp.data.banners.length > 0">
  36. <view :style="{height: temp.data.height + 'rpx'}" v-if="temp.data.effect == 1 || !temp.data.effect">
  37. <app-swiper
  38. :list="temp.data.banners"
  39. :autoplay="temp.data.autoplay === 0 ? true : false"
  40. name="pic_url"
  41. :effect3d="temp.data.style === 2 ? true : false"
  42. :height="temp.data.height"
  43. :effect3dPreviousMargin="50"
  44. :imgMode="temp.data.fill === 0 ? 'aspectFit' : 'scaleToFill'"
  45. :interval="temp.data.interval ? temp.data.interval : 3000"
  46. :duration="temp.data.duration ? temp.data.duration : 500"
  47. :mode="temp.data.mode"
  48. ></app-swiper>
  49. </view>
  50. <view :style="{height: temp.data.height + 'rpx'}" v-if="temp.data.effect == 2">
  51. <u-swiper
  52. :list="temp.data.banners"
  53. name="pic_url"
  54. :height="temp.data.height"
  55. :interval="temp.data.interval ? temp.data.interval : 3000"
  56. :duration="temp.data.duration ? temp.data.duration : 500"
  57. :mode="temp.data.mode"
  58. :imgMode="temp.data.fill === 0 ? 'aspectFit' : 'scaleToFill'"
  59. :autoplay="temp.data.autoplay === 0 ? true : false"
  60. >
  61. </u-swiper>
  62. </view>
  63. </template>
  64. </template>
  65. <!-- 普通商品列表 -->
  66. <template v-else-if="temp.id === 'goods'">
  67. <view
  68. :style="[
  69. {'background-color':`${temp.data.backgroundColor}`,
  70. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  71. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  72. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  73. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}
  74. ]">
  75. <template v-if="temp.data.catPosition === 'top'">
  76. <u-ordinary-list
  77. v-bind:theme="theme"
  78. v-bind:show-cat="temp.data.showCat"
  79. v-bind:cat-list="temp.data.catList"
  80. v-bind:cat-style="temp.data.catStyle"
  81. v-bind:list="temp.data.list"
  82. v-bind:list-style="temp.data.listStyle"
  83. v-bind:goods-style="temp.data.goodsStyle"
  84. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  85. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  86. v-bind:show-goods-tag="temp.data.showGoodsTag"
  87. v-bind:show-goods-name="temp.data.showGoodsName"
  88. v-bind:show-goods-price="temp.data.showGoodsPrice"
  89. v-bind:show-buy-btn="temp.data.showBuyBtn"
  90. v-bind:buy-btn="temp.data.buyBtn"
  91. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  92. v-bind:buy-btn-text="temp.data.buyBtnText"
  93. v-bind:button-color="temp.data.buttonColor"
  94. v-bind:text-style="temp.data.textStyle"
  95. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  96. v-bind:fill="temp.data.fill"
  97. v-bind:isDIY="true"
  98. v-on:buyProduct="buyProduct"
  99. :theme-object="themeObject"
  100. >
  101. </u-ordinary-list>
  102. </template>
  103. <template v-else>
  104. <app-recommended-product-list
  105. v-bind:show-cat="temp.data.showCat"
  106. v-bind:show-buy-btn="temp.data.showBuyBtn"
  107. v-bind:cat-style="temp.data.catStyle"
  108. v-bind:cat-list="temp.data.catList"
  109. v-bind:list="temp.data.list" :list-style="temp.data.listStyle"
  110. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  111. v-bind:fill="temp.data.fill" :goods-style="temp.data.goodsStyle"
  112. v-bind:show-goods-name="temp.data.showGoodsName"
  113. v-bind:show-goods-price="temp.data.showGoodsPrice"
  114. v-bind:buy-btn="temp.data.buyBtn" :sign="temp.id"
  115. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  116. v-bind:buy-btn-text="temp.data.buyBtnText"
  117. v-bind:show-goods-tag="temp.data.showGoodsTag"
  118. v-bind:customize-goods-tag="temp.data.customizeGoodsTag"
  119. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  120. v-bind:button-color="temp.data.buttonColor"
  121. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  122. v-bind:theme="theme"
  123. v-bind:cat-position="temp.data.catPosition"
  124. ></app-recommended-product-list>
  125. </template>
  126. </view>
  127. </template>
  128. <!-- 插件商品列表 -->
  129. <template v-else-if="temp.id === 'pintuan'
  130. || temp.id === 'miaosha'
  131. || temp.id === 'advance'
  132. || temp.id === 'booking'
  133. || temp.id === 'bargain'
  134. || temp.id === 'pick'
  135. || temp.id === 'lottery'
  136. || temp.id === 'integral-mall'
  137. || temp.id === 'gift'
  138. || temp.id === 'exchange'
  139. || temp.id === 'composition'
  140. || temp.id === 'flash-sale'
  141. || temp.id === 'wholesale'">
  142. <view :style="[
  143. {'background-color':`${temp.data.backgroundColor}`,
  144. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  145. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  146. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  147. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  148. >
  149. <template v-if="temp.id === 'integral-mall' && temp.data.showCoupon">
  150. <app-exclusive-coupon
  151. v-bind:none-color="true"
  152. v-bind:list="temp.data.coupon_list"
  153. v-bind:sign="temp.id"
  154. v-bind:text-color="temp.data.couponColor"
  155. v-bind:show-top="false"
  156. v-bind:coupon_req="coupon_req"
  157. v-bind:unclaimed-bg="temp.data.couponPicUrl"
  158. ></app-exclusive-coupon>
  159. </template>
  160. <app-diy-goods-list
  161. v-bind:show-buy-btn="temp.data.showBuyBtn"
  162. v-bind:list="temp.data.list"
  163. v-bind:list-style="temp.data.listStyle"
  164. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  165. v-bind:fill="temp.data.fill"
  166. v-bind:goods-style="temp.data.goodsStyle"
  167. v-bind:show-goods-name="temp.data.showGoodsName"
  168. v-bind:text-style="temp.data.textStyle"
  169. v-bind:sign="temp.id"
  170. v-bind:button-color="temp.data.buttonColor"
  171. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  172. v-bind:buy-btn-text="temp.data.buyBtnText"
  173. v-bind:show-goods-tag="temp.data.showGoodsTag"
  174. v-bind:page-hide="pageHide"
  175. v-bind:show-progress-bar="temp.data.showProgressBar"
  176. v-bind:customize-goods-tag="temp.data.customizeGoodsTag"
  177. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  178. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  179. v-bind:theme="theme"
  180. ></app-diy-goods-list>
  181. </view>
  182. </template>
  183. <template v-else-if="temp.id === 'rubik'">
  184. <view style="position: relative">
  185. <app-image-ad
  186. v-bind:image-style="temp.data.style"
  187. v-bind:list="temp.data.list"
  188. v-bind:height="temp.data.height"
  189. ></app-image-ad>
  190. <block v-for="(hotspot, hotspot_index) in temp.data.hotspot" v-bind:key="hotspot_index">
  191. <app-hotspot v-bind:hotspot="rubikHotspot(hotspot)"></app-hotspot>
  192. </block>
  193. </view>
  194. </template>
  195. <template v-else-if="temp.id === 'notice'">
  196. <u-announcement
  197. v-bind:bgColor="temp.data.background"
  198. v-bind:btn-color="temp.data.btnColor"
  199. v-bind:btn-height="temp.data.btnHeight"
  200. v-bind:btn-radius="`${temp.data.btnRadius}rpx`"
  201. v-bind:btn-text="temp.data.btnText"
  202. v-bind:btn-text-color="temp.data.btnTextColor"
  203. v-bind:btn-width="temp.data.btnWidth"
  204. v-bind:content="temp.data.content"
  205. v-bind:header-url="temp.data.headerUrl"
  206. v-bind:icon="temp.data.icon"
  207. v-bind:name="temp.data.name"
  208. v-bind:textColor="temp.data.textColor"
  209. ></u-announcement>
  210. </template>
  211. <template v-else-if="temp.id === 'nav'">
  212. <!-- 新数据 -->
  213. <template v-if="temp.data.modeType">
  214. <app-navigation-two-icon
  215. v-bind:mode-type="temp.data.modeType"
  216. v-bind:background="temp.data.backgroundColor"
  217. v-bind:color="temp.data.color"
  218. v-bind:navs="temp.data.navs"
  219. v-bind:columns="temp.data.columns"
  220. v-bind:temp-index="temp_index"
  221. v-bind:nav-type="temp.data.navType"
  222. v-bind:alone-num="temp.data.aloneNum"
  223. v-bind:line-num="temp.data.lineNum"
  224. v-bind:swiper-type="temp.data.swiperType"
  225. v-bind:swiper-color="temp.data.swiperColor"
  226. v-bind:swiper-no-color="temp.data.swiperNoColor"
  227. ></app-navigation-two-icon>
  228. </template>
  229. <!-- 老数据 -->
  230. <template v-else>
  231. <view
  232. :style="[
  233. {'background-color':`${temp.data.backgroundColor}`,
  234. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  235. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  236. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  237. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  238. >
  239. <app-navigation-icon
  240. v-bind:background="''"
  241. v-bind:color="temp.data.color"
  242. v-bind:rows="temp.data.rows"
  243. v-bind:columns="temp.data.columns"
  244. v-bind:scroll="temp.data.scroll"
  245. v-bind:navs="temp.data.navs"
  246. ></app-navigation-icon>
  247. </view>
  248. </template>
  249. </template>
  250. <template v-else-if="temp.id === 'video'">
  251. <app-video :pic-url="temp.data.pic_url" :url="temp.data.url"></app-video>
  252. </template>
  253. <template v-else-if="temp.id === 'link'">
  254. <app-associated-link
  255. v-bind:arrows-switch="temp.data.arrowsSwitch"
  256. v-bind:background="temp.data.background"
  257. v-bind:color="temp.data.color"
  258. v-bind:position="temp.data.position"
  259. v-bind:style-color="temp.data.styleColor"
  260. v-bind:link="Object.assign({}, temp.data.link)"
  261. v-bind:styleNum="temp.data.style"
  262. v-bind:pic-switch="temp.data.picSwitch"
  263. v-bind:pic-url="temp.data.picUrl"
  264. v-bind:font-size="temp.data.fontSize"
  265. v-bind:title="temp.data.title"
  266. ></app-associated-link>
  267. </template>
  268. <template v-else-if="temp.id === 'topic'">
  269. <template v-if="temp.data.style === 'normal'">
  270. <app-special-topic
  271. v-bind:count="temp.data.count"
  272. v-bind:icon="temp.data.icon"
  273. v-bind:logo_1="temp.data.logo_1"
  274. v-bind:logo_2="temp.data.logo_2"
  275. v-bind:topic_list="temp.data.topic_list"
  276. ></app-special-topic>
  277. </template>
  278. <template v-else-if="temp.data.style === 'list'">
  279. <app-special-topic-list
  280. v-bind:cat-show="temp.data.cat_show"
  281. v-bind:list="temp.data.list"
  282. v-bind:theme="theme"
  283. v-bind:topic-list="temp.data.topic_list"
  284. ></app-special-topic-list>
  285. </template>
  286. </template>
  287. <template v-else-if="temp.id === 'store'">
  288. <app-shop
  289. v-bind:list="temp.data.list"
  290. v-bind:nav-pic-url="temp.data.navPicUrl"
  291. v-bind:score-pic-url="temp.data.scorePicUrl"
  292. v-bind:show-name="temp.data.showName"
  293. v-bind:show-score="temp.data.showScore"
  294. v-bind:show-tel="temp.data.showTel"
  295. v-bind:scrollTop="scrollTop"
  296. ></app-shop>
  297. </template>
  298. <template v-else-if="temp.id === 'copyright'">
  299. <app-copyright
  300. v-bind:background-color="temp.data.backgroundColor"
  301. v-bind:text="temp.data.text"
  302. v-bind:pic-url="temp.data.picUrl"
  303. v-bind:link="temp.data.link"
  304. ></app-copyright>
  305. </template>
  306. <template v-else-if="temp.id === 'user-info'">
  307. <app-user-center
  308. v-bind:top-pic-url="temp.data.backgroundPicUrl"
  309. v-bind:member-pic-url="userCenter.member_pic_url"
  310. v-bind:top-style="temp.data.style"
  311. ></app-user-center>
  312. </template>
  313. <template v-else-if="temp.id === 'user-order'">
  314. <app-my-order
  315. v-bind:order_bar="temp.data.navs"
  316. v-bind:background-color="temp.data.backgroundColor"
  317. v-bind:theme="theme"
  318. ></app-my-order>
  319. </template>
  320. <!-- 优惠券 -->
  321. <template v-else-if="temp.id === 'coupon'">
  322. <app-exclusive-coupon-two
  323. background="#FFFFFF"
  324. v-bind:list="temp.data.coupon_list"
  325. v-bind:receive-bg="temp.data.receiveBg"
  326. v-bind:text-color="temp.data.textColor"
  327. v-bind:unclaimed-bg="temp.data.unclaimedBg"
  328. v-bind:coupon_req="coupon_req"
  329. v-bind:coupon-bg="temp.data.couponBg ? temp.data.couponBg : `#D9BC8B`"
  330. v-bind:coupon-bg-type="temp.data.couponBgType"
  331. v-bind:add-type="temp.data.addType"
  332. v-bind:page_id="page_id"
  333. v-bind:template_id="item.template_id"
  334. v-bind:d-index="[nav_active,temp_index]"
  335. v-bind:m-index="dIndex"
  336. v-bind:d-type="dType"
  337. ></app-exclusive-coupon-two>
  338. </template>
  339. <template v-else-if="temp.id === 'timer'">
  340. <app-diy-timer
  341. v-bind:pic-url="temp.data.picUrl"
  342. v-bind:start-date-time="temp.data.startDateTime"
  343. v-bind:end-date-time="temp.data.endDateTime"
  344. v-bind:page-hide="pageHide"
  345. v-bind:bg-pic-url="temp.data.bgPicUrl"
  346. v-bind:link="temp.data.link"
  347. ></app-diy-timer>
  348. </template>
  349. <template v-else-if="temp.id === 'mch'">
  350. <view :style="[
  351. {'background-color':`${temp.data.backgroundColor}`,
  352. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  353. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  354. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  355. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  356. >
  357. <app-goods-shop
  358. v-bind:card-style="temp.data.cardStyle"
  359. v-bind:background-color="temp.data.backgroundColor"
  360. type="diy"
  361. v-bind:theme="theme"
  362. v-bind:mch_list="temp.data.list"
  363. v-bind:coupon_req="coupon_req"
  364. v-bind:is_required="is_required"
  365. v-bind:show-goods="temp.data.showGoods"
  366. ></app-goods-shop>
  367. </view>
  368. </template>
  369. <template v-else-if="temp.id === 'empty'">
  370. <app-empty
  371. v-bind:height="temp.data.height"
  372. v-bind:background-color="temp.data.background"
  373. ></app-empty>
  374. </template>
  375. <template v-else-if="temp.id === 'ad'">
  376. <app-ad
  377. v-bind:unit-id="temp.data.id"
  378. v-bind:type="temp.data.type"
  379. v-bind:coupon-url="coupon_url"
  380. v-bind:video-url="temp.data.video_url"
  381. v-bind:pic-url="temp.data.pic_url"
  382. v-bind:coupon-params="item | getObje"
  383. ></app-ad>
  384. </template>
  385. <template v-else-if="temp.id === 'modal'">
  386. <app-popup-ad
  387. v-bind:opened="temp.data.opened"
  388. v-bind:times="temp.data.times"
  389. v-bind:list="temp.data.list"
  390. v-bind:multiple="true"
  391. v-bind:is_storage="is_storage"
  392. v-bind:mark="homePages.id + '-' + homePages.navs[nav_active].id + '-' + temp_index"
  393. ></app-popup-ad>
  394. </template>
  395. <template v-else-if="temp.id === 'quick-nav' && temp.data.navSwitch == 1">
  396. <app-quick-navigation
  397. v-bind:value="temp.data"
  398. v-bind:use-mall-config="temp.data.useMallConfig"
  399. ></app-quick-navigation>
  400. </template>
  401. <!-- #ifdef MP-WEIXIN -->
  402. <template v-else-if="temp.id === 'mp-link'">
  403. <view v-bind:class="temp.data.position === 'top' ? `mp-link-top` : ``">
  404. <official-account
  405. v-on:load="mpLink(temp.data.position)"
  406. v-on:error="mpLinkError"
  407. ></official-account>
  408. </view>
  409. </template>
  410. <!-- #endif -->
  411. <!-- #ifndef MP-TOUTIAO -->
  412. <template v-else-if="temp.id === 'map'">
  413. <app-map
  414. v-bind:background-pic-url="temp.data.backgroundPicUrl"
  415. v-bind:height="temp.data.height"
  416. v-bind:latitude="temp.data.latitude"
  417. v-bind:longitude="temp.data.longitude"
  418. v-bind:margin-top="temp.data.marginTop"
  419. v-bind:margin-top-color="temp.data.marginTopColor"
  420. v-bind:padding-x="temp.data.paddingX"
  421. v-bind:padding-y="temp.data.paddingY"
  422. ></app-map>
  423. </template>
  424. <!-- #endif -->
  425. <template v-else-if="temp.id === 'check-in'">
  426. <app-check-in
  427. v-bind:background-pic-url="temp.data.backgroundPicUrl"
  428. v-bind:hotspot="temp.data.hotspot"
  429. v-bind:show-text="temp.data.showText"
  430. v-bind:text-color="temp.data.textColor"
  431. v-bind:text-position="temp.data.textPosition"
  432. ></app-check-in>
  433. </template>
  434. <template v-else-if="temp.id === 'image-text'">
  435. <view style="padding: 0 24rpx;">
  436. <app-rich v-bind:content='temp.data.content'></app-rich>
  437. </view>
  438. </template>
  439. <template v-else-if="temp.id === 'form'">
  440. <app-diy-form
  441. v-bind:title="temp.name"
  442. v-bind:list="temp.data.formDialog"
  443. v-bind:item-padding-x="temp.data.inputPadding"
  444. v-bind:item-margin-y="temp.data.marginBottom"
  445. v-bind:item-height="temp.data.height"
  446. v-bind:show-item-border="false"
  447. v-bind:label-position="transLabelPosition(temp.data.style)"
  448. v-bind:label-color="temp.data.inputLabel"
  449. label-text-align="left"
  450. v-bind:show-input-border="true"
  451. v-bind:input-background="temp.data.inputBackground"
  452. v-bind:input-border-color="temp.data.inputBorder"
  453. v-bind:input-text-color="temp.data.inputText"
  454. v-bind:input-placeholder-color="temp.data.inputTip"
  455. v-bind:input-radius="temp.data.radius"
  456. v-bind:show-submit="true"
  457. v-bind:submit-url="diyFormSubmitUrl"
  458. v-bind:submit-btn-text="temp.data.borderContent"
  459. v-bind:submit-btn-height="temp.data.buttonHeight"
  460. v-bind:submit-btn-padding="temp.data.buttonPadding"
  461. v-bind:submit-btn-margin="temp.data.buttonMargin"
  462. v-bind:submit-btn-radius="temp.data.buttonRadius"
  463. v-bind:submit-btn-background="temp.data.borderBackground"
  464. v-bind:submit-btn-border-color="temp.data.borderBorder"
  465. v-bind:submit-btn-text-color="temp.data.borderText"
  466. v-bind:background-color="temp.data.backgroundColor"
  467. v-bind:background-image="temp.data.backgroundPicUrl"
  468. v-bind:background-width="temp.data.backgroundWidth"
  469. v-bind:background-height="temp.data.backgroundHeight"
  470. v-bind:background-position="transLabelBackgroundPosition(temp.data.position)"
  471. v-bind:background-repeat="transLabelBackgroundRepeat(temp.data.mode)"
  472. v-bind:margin-top="temp.data.marginTop"
  473. v-bind:margin-color="temp.data.marginColor"
  474. v-bind:padding-top="temp.data.padding"
  475. v-bind:padding-bottom="temp.data.padding"
  476. v-bind:select-box-color="temp.data.selectBoxColor"
  477. ></app-diy-form>
  478. </template>
  479. <!--超级会员卡组件-->
  480. <template v-else-if="temp.id === 'vip-card'">
  481. <app-vip-card
  482. v-bind:value="temp.data" top="0"
  483. v-bind:background="temp.data.background"
  484. ></app-vip-card>
  485. </template>
  486. <!--直播组件-->
  487. <!-- #ifdef MP-WEIXIN -->
  488. <template v-else-if="temp.id === 'live'">
  489. <app-live v-bind:value="temp.data"></app-live>
  490. </template>
  491. <!-- #endif -->
  492. <template v-else-if="temp.id === 'module' && is_module">
  493. <app-module
  494. v-bind:tab-type="temp.data.tabType"
  495. v-bind:tab-color="temp.data.tabColor"
  496. v-bind:text-color="temp.data.textColor"
  497. v-bind:tab-background="temp.data.tabBackground"
  498. v-bind:list="temp.data.list"
  499. v-bind:d-index="[index, temp_index]"
  500. v-bind:theme="theme"
  501. v-bind:page-hide="pageHide"
  502. v-bind:home-pages="homePages"
  503. v-bind:is_storage="is_storage"
  504. v-bind:page_id="page_id"
  505. v-bind:is_required="is_required"
  506. v-bind:coupon_req="coupon_req"
  507. @buyProduct="buyProduct"
  508. ></app-module>
  509. </template>
  510. </block>
  511. </template>
  512. </block>
  513. </view>
  514. </view>
  515. </template>
  516. <script>
  517. import {mapState} from 'vuex';
  518. import appSearchFor from '../../page-component/app-search-for/app-search-for.vue';
  519. import appSwiper from '../../page-component/app-swiper/app-swiper.vue';
  520. import uSwiper from '../../page-component/app-swiper/swiper.vue';
  521. import uAnnouncement from '../../page-component/u-announcement/u-announcement.vue';
  522. import appNavigationIcon from '../../page-component/app-navigation-icon/app-navigation-icon.vue';
  523. import appNavigationTwoIcon from '../../page-component/app-navigation-icon/app-navigation-two-icon.vue';
  524. import appVideo from '../../page-component/app-video/app-video.vue';
  525. import appAssociatedLink from '../../page-component/app-associated-link/app-associated-link.vue';
  526. import appSpecialTopic from '../../page-component/app-special-topic/app-special-topic-normal.vue';
  527. import appSpecialTopicList from '../../page-component/app-special-topic/app-special-topic-list.vue';
  528. import appImageAd from '../../page-component/app-image-ad/app-image-ad.vue';
  529. import appHotspot from '../../basic-component/app-hotspot/app-hotspot.vue';
  530. import appShop from '../../page-component/app-shop/app-shop.vue';
  531. import appCopyright from '../../page-component/app-copyright/app-copyright.vue';
  532. import appUserCenter from '../../page-component/app-user-center-top/app-user-center-top.vue';
  533. import appMyOrder from '../../page-component/app-my-order/app-my-order.vue';
  534. import appRecommendedProductList from '../../page-component/app-recommended-product/app-recommended-product-list.vue';
  535. import appExclusiveCoupon from '../../page-component/app-exclusive-coupon/app-exclusive-coupon.vue';
  536. import appExclusiveCouponTwo from '../../page-component/app-exclusive-coupon/app-exclusive-coupon-two.vue';
  537. import appDiyTimer from '../../page-component/app-diy-timer/app-diy-timer.vue';
  538. import appGoodsShop from '../../page-component/app-good-shop-recommendation/app-good-shop-recommendation.vue';
  539. import appEmpty from '../../basic-component/app-empty/app-empty.vue';
  540. import appPopupAd from '../../page-component/app-popup-ad/app-popup-ad.vue';
  541. import appQuickNavigation from '../../page-component/app-quick-navigation/app-quick-navigation.vue';
  542. import appCheckIn from '../../page-component/app-check-in/app-check-in.vue';
  543. import appRich from '../../basic-component/app-rich/parse.vue';
  544. import appReservation from "../../page-component/app-reservation/app-reservation.vue";
  545. import appSpike from "../../page-component/app-spike/app-spike.vue";
  546. import appDiyGoodsList from "../../page-component/app-diy-goods-list/app-diy-goods-list.vue";
  547. import appDiyForm from "../../page-component/app-diy-form/app-diy-form.vue";
  548. import appVipCard from "../../page-component/app-vip-card/app-vip-card.vue";
  549. import appAd from "../../page-component/app-ad/app-ad.vue";
  550. import appModule from "../../page-component/index/app-module.vue";
  551. import uOrdinaryList from '../u-goods-list/u-ordinary-list.vue';
  552. // #ifdef MP-WEIXIN
  553. import appLive from "../../page-component/app-live/app-live.vue";
  554. // #endif
  555. // #ifndef MP-TOUTIAO
  556. import appMap from "../../page-component/app-map/app-map.vue";
  557. // #endif
  558. export default {
  559. name: "app-diy-page",
  560. components: {
  561. 'app-search-for': appSearchFor,
  562. 'app-swiper': appSwiper,
  563. uAnnouncement,
  564. 'app-navigation-icon': appNavigationIcon,
  565. 'app-navigation-two-icon': appNavigationTwoIcon,
  566. 'app-video': appVideo,
  567. 'app-associated-link': appAssociatedLink,
  568. 'app-special-topic': appSpecialTopic,
  569. 'app-special-topic-list': appSpecialTopicList,
  570. 'app-image-ad': appImageAd,
  571. 'app-hotspot': appHotspot,
  572. 'app-shop': appShop,
  573. 'app-copyright': appCopyright,
  574. 'app-user-center': appUserCenter,
  575. 'app-my-order': appMyOrder,
  576. 'app-recommended-product-list': appRecommendedProductList,
  577. 'app-exclusive-coupon': appExclusiveCoupon,
  578. appExclusiveCouponTwo,
  579. 'app-diy-timer': appDiyTimer,
  580. 'app-goods-shop': appGoodsShop,
  581. 'app-empty': appEmpty,
  582. 'app-popup-ad': appPopupAd,
  583. 'app-quick-navigation': appQuickNavigation,
  584. 'app-check-in': appCheckIn,
  585. 'app-rich': appRich,
  586. 'app-reservation': appReservation,
  587. 'app-spike': appSpike,
  588. 'app-diy-goods-list': appDiyGoodsList,
  589. 'app-diy-form': appDiyForm,
  590. 'app-vip-card': appVipCard,
  591. // 普通商品列表
  592. uOrdinaryList,
  593. // #ifndef MP-TOUTIAO
  594. appMap,
  595. // #endif
  596. appAd,
  597. appModule,
  598. // #ifdef MP-WEIXIN
  599. appLive,
  600. // #endif
  601. uSwiper
  602. },
  603. props: {
  604. dIndex: {
  605. type: Array,
  606. default() {
  607. return [0, 0];
  608. }
  609. },
  610. dType: String, //module 模块
  611. homePages: {
  612. type: Object,
  613. default() {
  614. return {
  615. navs: []
  616. };
  617. }
  618. },
  619. scrollTop: {
  620. type: Number,
  621. default() {
  622. return 0;
  623. }
  624. },
  625. is_storage: Boolean,
  626. pageHide: Boolean,
  627. theme: String,
  628. coupon_req: Boolean,
  629. is_required: Boolean,
  630. page_id: Number,
  631. is_module: {
  632. type: Boolean,
  633. default() {
  634. return true;
  635. }
  636. }
  637. },
  638. computed: {
  639. newData() {
  640. if (this.homePages) {
  641. if (this.homePages.title) {
  642. uni.setNavigationBarTitle({
  643. title: this.homePages.title,
  644. });
  645. }
  646. return this.homePages;
  647. } else {
  648. return {
  649. navs: [],
  650. }
  651. }
  652. },
  653. ...mapState({
  654. userCenter: state => state.mallConfig.user_center,
  655. }),
  656. diyFormSubmitUrl() {
  657. return this.$api.diy.page_store;
  658. },
  659. themeObject:function() {
  660. return {
  661. back: this.theme + '-m-back ' + this.theme,
  662. backP: this.theme + '-m-back-p ' + this.theme,
  663. backO: this.theme + '-m-back-o ' + this.theme,
  664. theme: this.theme,
  665. color: this.theme + '-m-text ' + this.theme,
  666. sBack: this.theme + '-s-back ' + this.theme,
  667. border: this.theme + '-m-border ' + this.theme,
  668. }
  669. },
  670. },
  671. data() {
  672. return {
  673. nav_active: 0,
  674. mp_link_top: false,
  675. coupon_url: this.$api.diy.receive,
  676. coupon_params: {}
  677. };
  678. },
  679. filters: {
  680. getObje(data) {
  681. if (!data) return;
  682. return {
  683. template_id: data.template_id
  684. }
  685. }
  686. },
  687. methods: {
  688. changeNav(index) {
  689. this.nav_active = index;
  690. this.mp_link_top = false;
  691. },
  692. rubikHotspot(hotspot) {
  693. if (hotspot && hotspot.link) {
  694. hotspot.link.url = hotspot.link.value;
  695. hotspot.link.openType = hotspot.link.open_type;
  696. }
  697. return hotspot;
  698. },
  699. mpLink(position) {
  700. if (position === 'top') {
  701. this.mp_link_top = true;
  702. }
  703. },
  704. transLabelPosition(val) {
  705. val = Number(val);
  706. switch (val) {
  707. case 3:
  708. return 'top';
  709. case 2:
  710. return 'inset';
  711. default:
  712. return 'left';
  713. }
  714. },
  715. transLabelBackgroundPosition(val) {
  716. val = Number(val);
  717. switch (val) {
  718. case 1:
  719. return 'left top';
  720. case 2:
  721. return 'center top';
  722. case 3:
  723. return 'right top';
  724. case 4:
  725. return 'left center';
  726. case 5:
  727. return 'center center';
  728. case 6:
  729. return 'right center';
  730. case 7:
  731. return 'left bottom';
  732. case 8:
  733. return 'center bottom';
  734. case 9:
  735. return 'right bottom';
  736. default:
  737. return 'center';
  738. }
  739. },
  740. transLabelBackgroundRepeat(val) {
  741. val = Number(val);
  742. switch (val) {
  743. case 1:
  744. return 'no-repeat';
  745. case 2:
  746. return 'repeat-x';
  747. case 3:
  748. return 'repeat-y';
  749. case 4:
  750. return 'repeat';
  751. default:
  752. return 'no-repeat';
  753. }
  754. },
  755. mpLinkError() {
  756. this.mp_link_top = false;
  757. },
  758. buyProduct(data) {
  759. this.$emit('buyProduct', data);
  760. }
  761. }
  762. }
  763. </script>
  764. <style scoped lang="scss">
  765. .app-diy-bg {
  766. position: fixed;
  767. top: 0;
  768. left: 0;
  769. width: 100%;
  770. height: 100%;
  771. z-index: -1;
  772. }
  773. //#ifdef MP-ALIPAY
  774. .app-diy-page /deep/ .app-diy-page {
  775. position: static !important;
  776. z-index: auto !important;
  777. }
  778. //#endif
  779. .app-diy-page {
  780. width: 100%;
  781. height: 100%;
  782. .nav-bar {
  783. position: fixed;
  784. left: 0;
  785. top: 0;
  786. z-index: 1500;
  787. background-color: #ffffff;
  788. width: 100%;
  789. height: #{44px};
  790. padding: 0 #{30rpx};
  791. overflow-x: auto;
  792. border-bottom: #{1rpx} solid #e2e2e2;
  793. .nav-bar-one {
  794. width: auto;
  795. margin-right: #{30rpx};
  796. padding: 0 #{15rpx};
  797. &.active {
  798. border-bottom: #{4rpx} solid;
  799. }
  800. }
  801. &.mp_link_top {
  802. top: #{84px};
  803. }
  804. &.mp_link_top ~ .diy-template {
  805. margin-top: #{44px + 84px};
  806. }
  807. & ~ .diy-template {
  808. margin-top: #{44px};
  809. }
  810. }
  811. .mp-link-top {
  812. position: fixed;
  813. top: 0;
  814. left: 0;
  815. z-index: 1500;
  816. width: 100%;
  817. }
  818. &.mp_link_top {
  819. margin-top: #{168rpx};
  820. }
  821. }
  822. </style>