selectionsquare.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  1. <template>
  2. <view class="nav">
  3. <view class="bg_box" style="background-color: #FFFFFF;" :style="{
  4. backgroundImage: mysNavConfig.bgImage,
  5. paddingTop: navBarTop,
  6. height: navBarHeight,
  7. opacity: opacity,
  8. }" :class="{ fixed: mysNavConfig.navFixed }"></view>
  9. <view class="mys_navBar" :style="{
  10. paddingTop: navBarTop,
  11. height: navBarHeight,
  12. paddingRight: navBarRight,
  13. }" :class="{ fixed: mysNavConfig.navFixed }">
  14. <!-- 左slot -->
  15. <view class="my_left_custom" :style="{ height: btnHeight }">
  16. <slot name="left"></slot>
  17. </view>
  18. <view class="btn_type" :style="{ height: btnHeight }">
  19. <view class="btn_box nav_btn_t1" :style="{
  20. width: btnWidth,
  21. height: btnHeight,
  22. marginLeft: navBarLeft,
  23. borderRadius: mysNavConfig.type2Config.radius,
  24. }">
  25. <view class="btn_back" @tap="onLeftClick()">
  26. <image class="nv_icon" :src="mysNavConfig.type2Config.leftPath"
  27. :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
  28. </view>
  29. <view class="line"></view>
  30. <view class="btn_home" @tap="onLeftHome('top')">
  31. <image class="nv_icon" :src="mysNavConfig.type2Config.rightPath"
  32. :style="{ height: btnHeight, width: iconW }" mode="aspectFit" />
  33. </view>
  34. </view>
  35. <!-- 标题 -->
  36. <view class="title_container" v-if="!mysNavConfig.searchConfig"
  37. :style="{ top: navBarTop, height: btnHeight }">
  38. <text class="title_text" v-if="!!mysNavConfig.navTitle" :style="{
  39. color: mysNavConfig.navTitle.color,
  40. fontSize: mysNavConfig.navTitle.fontSize,
  41. fontWeight: mysNavConfig.navTitle.fontWeight,
  42. }">{{ mysNavConfig.navTitle.text }}</text>
  43. <slot name="center2"></slot>
  44. </view>
  45. </view>
  46. </view>
  47. <aTip text="点击添加到我的小程序 \n下次访问更方便哦!" isCustom="true" />
  48. <view :style="{marginTop:navH}"></view>
  49. <view class="home">
  50. <view>
  51. <!-- 多选框弹窗 -->
  52. <uni-popup ref="popup" background-color="#fff">
  53. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  54. <view class="option1" style="margin-top: 20%;">
  55. <h3 style="margin-bottom: 10rpx;">社媒平台</h3>
  56. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby" :localdata="hobby">
  57. </uni-data-checkbox>
  58. </view>
  59. <view class="option2">
  60. <h3 style="margin-bottom: 10rpx;">样品形式</h3>
  61. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby1" :localdata="hobby1">
  62. </uni-data-checkbox>
  63. </view>
  64. <view class="option3">
  65. <h3 style="margin-bottom: 10rpx;">任务形式</h3>
  66. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby2" :localdata="hobby2">
  67. </uni-data-checkbox>
  68. </view>
  69. <view class="butto">
  70. <button class="mini-btn" size="mini" @tap="reset">重置</button>
  71. <button class="mini-btn" size="mini" @tap="submitSearch">确定</button>
  72. </view>
  73. </view>
  74. </uni-popup>
  75. </view>
  76. <!-- banner -->
  77. <view class="uni-margin-wrap">
  78. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
  79. :interval="interval" :duration="duration">
  80. <swiper-item v-for="item in list1" @click="pick(item)">
  81. <image :src="item.img" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
  82. </swiper-item>
  83. </swiper>
  84. </view>
  85. <view class="commodity" style="margin-top: 3%;">
  86. <view class="project" v-for="(item,index) in selectionList" :key="index" @tap="toDetail(item)">
  87. <!-- 主图 -->
  88. <view class="projectdiagram" :style="{backgroundImage:`url(${item.coverphoto})`}">
  89. <view class="Mask" v-if="item.isFinished">
  90. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png" mode="">
  91. </image>
  92. </view>
  93. <view v-else>
  94. <view class="Mask" v-if="item.isLacked">
  95. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/lack.png"
  96. mode="">
  97. </image>
  98. </view>
  99. </view>
  100. <view style="padding-left: 4%;padding-top: 2%;">
  101. </view>
  102. </view>
  103. <!-- 平台logo、项目名称 -->
  104. <view class="projecttext">
  105. <image :src="item.platform_icon">
  106. </image>
  107. <span>{{item.selection_name|ellipsis}}</span>
  108. </view>
  109. <!-- 项目信息1 -->
  110. <view class="projectinfo">
  111. <view class="projectinfotxt">
  112. <p>售价</p>
  113. <p>¥{{item.show_price}}</p>
  114. </view>
  115. <view class="projectinfotxt">
  116. <p>预估赚</p>
  117. <p style="color: #f70606;">¥{{item.show_commission}}</p>
  118. </view>
  119. <view class="projectinfotxt">
  120. <p>佣金</p>
  121. <p>{{item.commission_rate}}%</p>
  122. </view>
  123. <view class="projectinfotxt" v-if="item.task_mode == 1">
  124. <p>额外悬赏</p>
  125. <p style="color: #f70606;">¥{{item.show_task_reward}}</p>
  126. </view>
  127. </view>
  128. <!-- 项目信息2 -->
  129. <view class="projectinfo" style="justify-content: space-between;">
  130. <view class="projectinfotxt" style="margin: 0 10rpx;">
  131. <p>余<span style="color: #52b2f0;">{{item.remain_num}}</span>件</p>
  132. </view>
  133. <view class="projectinfotag">
  134. <view class="TitleText" v-if="item.sample_mode == 1">
  135. <p>免费领</p>
  136. </view>
  137. <view class="TitleText" v-if="item.sample_mode == 2">
  138. <p>垫付后返</p>
  139. </view>
  140. <view class="TitleText" v-if="item.task_mode == 1">
  141. <p>悬赏</p>
  142. </view>
  143. <view class="TitleText" v-else>
  144. <p>纯佣</p>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- 普通弹窗 公众号-->
  151. <uni-popup ref="popup4" class="share" background-color="#fff" @change="change" :maskClick="false">
  152. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  153. <view class="sharepage">
  154. <view class="projecttext1">
  155. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/younggee_logo.png"
  156. style="width: 250rpx; height: 80rpx;" mode=""></image>
  157. <!-- <span>YoungGee</span> -->
  158. </view>
  159. <view class="sharemap">
  160. <image :src="kefuUrl" style="width: 400rpx;height: 400rpx;" mode=""></image>
  161. </view>
  162. <view style="margin: 30rpx 0;">
  163. <button class="butmin1" size="mini" @tap="saveImage">保存二维码</button>
  164. </view>
  165. <view class="sharetxt">
  166. <text>
  167. 使用样叽的过程中,有任何疑问,\n
  168. 请添加上方微信。\n
  169. 我们保证及时全力为您解决!
  170. </text>
  171. </view>
  172. <view style="margin: 30rpx 0;">
  173. <button class="butmin" size="mini" @tap="closepop">知道了</button>
  174. </view>
  175. </view>
  176. </view>
  177. </uni-popup>
  178. <view class="contact" @click="toggle4('center')">
  179. <view class="contt">
  180. <!-- <image class="img2" src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home2.png" mode=""></image> -->
  181. <image class="img1"
  182. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu_20211124192542.png" mode="">
  183. </image>
  184. </view>
  185. </view>
  186. </view>
  187. </view>
  188. </view>
  189. </template>
  190. <script>
  191. import aTip from "@/components/mys-tip_1.0.01/a_tip/aTip";
  192. import {
  193. getQueryString,
  194. fansview,
  195. money,
  196. getDaysBetweenDates
  197. } from '@/components/utils.js';
  198. import {
  199. saveImageToPhotosAlbum,
  200. showToast,
  201. downloadFile
  202. } from '@/uni_modules/sakura-canvas/js_sdk/util'
  203. export default {
  204. props: {
  205. mysNavConfig: {
  206. type: Object,
  207. default () {
  208. return {
  209. /* 固定导航 */
  210. navFixed: true,
  211. /* 开启单页显示首页图标 */
  212. isHome: true,
  213. /* 占位开启 */
  214. navPadding: true,
  215. /* 背景 */
  216. bgColor: "#f8f8f8",
  217. /* 渐变色 */
  218. opacity: 1,
  219. /* 渐变开启 */
  220. isOpacity: false,
  221. /* 渐变延时效果 */
  222. opacityTime: 100,
  223. /* 左侧按钮样式 可选 type1 type2 (type2根据小程序胶囊位置调整) */
  224. btnType: "type1",
  225. /* type1 左侧文字配置 */
  226. leftText: {
  227. text: "",
  228. color: "",
  229. fontSize: "16px", // px upx rpx
  230. fontWeight: "", // blod
  231. },
  232. /* 标题 */
  233. navTitle: {
  234. text: "带货",
  235. color: "",
  236. fontSize: "32rpx", // px upx rpx
  237. fontWeight: "normal", // blod
  238. },
  239. /* type2 按钮 */
  240. type2Config: {
  241. // 左图标
  242. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png3.png",
  243. // 右图标
  244. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png1.png",
  245. // 圆角
  246. radius: "40rpx",
  247. },
  248. };
  249. },
  250. },
  251. scrollTop: {
  252. type: Number,
  253. default: function() {
  254. return 0;
  255. },
  256. },
  257. },
  258. filters: {
  259. ellipsis(value) {
  260. if (!value) return "";
  261. if (value.length > 20) {
  262. return value.slice(0, 20) + "...";
  263. }
  264. return value;
  265. },
  266. },
  267. components: {
  268. aTip
  269. },
  270. data() {
  271. return {
  272. // nav
  273. navH: getApp().globalData.navHeight,
  274. kefuUrl: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu.jpeg",
  275. iconW: undefined,
  276. iconH: undefined,
  277. btnWidth: undefined,
  278. btnHeight: undefined,
  279. navBarTop: undefined,
  280. navBarHeight: undefined,
  281. navBarLeft: undefined,
  282. navBarRight: undefined,
  283. inputHeight: undefined,
  284. // banner
  285. indicatorDots: true,
  286. autoplay: true,
  287. interval: 3000,
  288. duration: 1000,
  289. // 多选框
  290. formData: {
  291. hobby: [],
  292. hobby1: [],
  293. hobby2: [],
  294. },
  295. hobby: [{
  296. text: '红book',
  297. value: 1
  298. }, {
  299. text: '抖音',
  300. value: 2
  301. }, {
  302. text: '微博',
  303. value: 3
  304. }, {
  305. text: '快手',
  306. value: 4
  307. }, {
  308. text: 'B站',
  309. value: 5
  310. }, {
  311. text: '大众点评',
  312. value: 6
  313. }, {
  314. text: '知乎',
  315. value: 7
  316. }],
  317. hobby1: [{
  318. text: '免费领样',
  319. value: 1
  320. }, {
  321. text: '垫付后返',
  322. value: 2
  323. }, {
  324. text: '不提供样品',
  325. value: 3
  326. }],
  327. hobby2: [{
  328. text: '悬赏任务',
  329. value: 1
  330. }, {
  331. text: '纯佣带货',
  332. value: 2
  333. }],
  334. list1: [{
  335. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
  336. name: '/page_tasksquare/banner/guide'
  337. },
  338. {
  339. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home7.png',
  340. name: '/page_tasksquare/banner/cooperation'
  341. }
  342. ],
  343. per: 0,
  344. max_page: 0,
  345. filtCondition: '',
  346. selectionList: [],
  347. }
  348. },
  349. watch: {
  350. scrollTop(val) {
  351. if (!this.mysNavConfig.isOpacity) {
  352. return;
  353. }
  354. this.setOpacity(val, this.mysNavConfig.opacityTime);
  355. },
  356. },
  357. created() {
  358. this.init();
  359. },
  360. async onShow() {
  361. this.isLoginApi()
  362. await this.getInfoListApi()
  363. this.per = 0
  364. this.selectionList = []
  365. this.getSelectionListApi()
  366. },
  367. async onLoad() {},
  368. //下拉刷新
  369. onPullDownRefresh() {
  370. this.per = 0
  371. this.selectionList = []
  372. this.getSelectionListApi()
  373. //停止下拉刷新
  374. uni.stopPullDownRefresh()
  375. },
  376. // 下拉懒加载
  377. async onReachBottom() {
  378. ++this.per;
  379. if (this.per >= this.max_page) {
  380. uni.showToast({
  381. title: "已加载全部"
  382. })
  383. } else {
  384. uni.showLoading({
  385. title: '加载中'
  386. })
  387. await this.getSelectionListApi()
  388. uni.hideLoading();
  389. }
  390. },
  391. methods: {
  392. /**
  393. * @param scrollTop 页面顶部距离
  394. * @param down 滑动显示效果延时
  395. */
  396. setOpacity(scrollTop, down = 60) {
  397. if (scrollTop > 0) {
  398. if (scrollTop < down) {
  399. this.opacity = scrollTop / down;
  400. }
  401. if (scrollTop > down) {
  402. this.opacity = 1;
  403. }
  404. } else {
  405. this.opacity = 0;
  406. }
  407. },
  408. /* type2 点击分类 */
  409. onLeftHome(type) {
  410. this.type = type
  411. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  412. this.$refs.popup.open(type)
  413. },
  414. init() {
  415. if (this.mysNavConfig.isHome) {
  416. let pages = getCurrentPages().length;
  417. /* 单页显示home图标 */
  418. pages === 1 ? (this.isHome = true) : (this.isHome = false);
  419. }
  420. // 开启渐变 强制fixed
  421. this.navBarTop = uni.getSystemInfoSync().statusBarHeight +
  422. "px";
  423. if (!this.mysNavConfig.opacity) {
  424. this.opacity = 1;
  425. !this.mysNavConfig.isOpacity ? (this.opacity = 1) : ((this
  426. .mysNavConfig.navFixed = true), (this
  427. .opacity = 0));
  428. } else {
  429. this.opacity = this.mysNavConfig.opacity;
  430. !this.mysNavConfig.isOpacity ? "" : ((this.mysNavConfig
  431. .navFixed = true), (this.opacity = 0));
  432. }
  433. // #ifdef MP
  434. this.initMP();
  435. // #endif
  436. // #ifdef APP-PLUS-NVUE
  437. this.navBarHeight = 44 + uni.getSystemInfoSync()
  438. .statusBarHeight + "px";
  439. // #endif
  440. },
  441. /* 小程序初始化位置 */
  442. initMP() {
  443. // getSystemInfoSync用于获取系统信息同步接口
  444. let gS = uni.getSystemInfoSync();
  445. // getMenuButtonBoundingClientRect用于获取胶囊按钮位置布局信息
  446. let rect = uni.getMenuButtonBoundingClientRect();
  447. let rectHeight = rect.height;
  448. this.btnWidth = rect.width + "px";
  449. this.btnHeight = rectHeight + "px";
  450. this.iconW = Math.floor(rect.width / 4 - 5) + "px";
  451. this.iconH = rectHeight / 2 + "px";
  452. this.inputHeight = rectHeight - 3 + "px";
  453. this.navBarTop = rect.top + "px";
  454. this.navBarLeft = gS.screenWidth - rect.right + "px";
  455. this.navBarRight = gS.screenWidth - rect.right + rect.width +
  456. "px";
  457. this.navBarHeight = gS.statusBarHeight + rectHeight + (rect
  458. .top - gS.statusBarHeight) * 2 + "px";
  459. },
  460. toDetail(item) {
  461. uni.navigateTo({
  462. url: '/page_selectionsquare/selectiondetail/selectiondetail?id=' + item.selection_id
  463. });
  464. },
  465. async submitSearch() {
  466. this.per = 0;
  467. this.$refs.popup.close()
  468. var filtCondition = ''
  469. for (var i = 0; i < this.formData.hobby.length; i++) {
  470. filtCondition += "&platform[]" + "=" + this.formData.hobby[i]
  471. }
  472. for (var j = 0; j < this.formData.hobby1.length; j++) {
  473. filtCondition += "&secform[]" + "=" + this.formData.hobby1[j]
  474. }
  475. for (var j = 0; j < this.formData.hobby2.length; j++) {
  476. filtCondition += "&taskform[]" + "=" + this.formData.hobby2[j]
  477. }
  478. this.filtCondition = filtCondition
  479. uni.showLoading({
  480. title: '加载中'
  481. });
  482. this.selectionList = []
  483. await this.getSelectionListApi()
  484. uni.hideLoading();
  485. },
  486. async reset() {
  487. this.per = 0;
  488. this.$refs.popup.close()
  489. this.formData.hobby = [];
  490. this.formData.hobby1 = [];
  491. this.formData.hobby2 = [];
  492. this.filtCondition = '';
  493. uni.showLoading({
  494. title: '加载中'
  495. });
  496. this.selectionList = []
  497. await this.getSelectionListApi()
  498. uni.hideLoading();
  499. },
  500. /* 点击左侧 */
  501. onLeftClick() {
  502. uni.navigateTo({
  503. url: '/page_selectionsquare/search'
  504. });
  505. },
  506. isLoginApi() {
  507. return this.$https.get('/youngee/c/t/g/is-login')
  508. .then(res => {
  509. if (res.data.code === 403) {
  510. // 登陆已失效
  511. this.token = ""
  512. uni.clearStorage();
  513. } else {
  514. this.token = uni.getStorageSync('token')
  515. }
  516. })
  517. },
  518. getInfoListApi() {
  519. return this.$http.get('/youngee/c/g/get-info-tables')
  520. .then(res => {
  521. this.hobby = []
  522. this.platformList = res.data.data.ThirdPlatform
  523. let l = this.platformList != null ? this.platformList.length : 0;
  524. for (var i = 0; i < l; i++) {
  525. var obj = {}
  526. obj.text = this.platformList[i].platform_name
  527. obj.value = this.platformList[i].id
  528. this.hobby.push(obj)
  529. }
  530. })
  531. },
  532. getSelectionListApi() {
  533. return this.$http.get('/youngee/c/g/get-selection-list' +
  534. "?" +
  535. "idx" +
  536. "=" +
  537. this.per +
  538. "&cnt" +
  539. "=" +
  540. 20 + this.filtCondition
  541. ).then(res => {
  542. if (res.data.code === 0) {
  543. console.log("res: ", res.data.data)
  544. // 获取res返回数据
  545. this.max_page = res.data.data.max_page
  546. let selectionList = res.data.data.SeletionInfos
  547. const count = res.data.data.count
  548. // 数据处理
  549. if (selectionList === null) {
  550. return
  551. }
  552. for (var i = 0; i < selectionList.length; i++) {
  553. // 封面图片
  554. selectionList[i].ProductInfo = JSON.parse(selectionList[i].product_snap);
  555. // if (selectionList[i] !== undefined && 'product_snap' in selectionList[i]) {
  556. // }
  557. // 封面图片
  558. let ProductPhoto = JSON.parse(selectionList[i].product_photo_snap);
  559. for (let j = 0; j < ProductPhoto.length; ++j) {
  560. if (ProductPhoto[j].Symbol == 1) {
  561. selectionList[i].coverphoto = ProductPhoto[j].PhotoUrl
  562. }
  563. }
  564. // if (selectionList[i] !== undefined && 'product_photo_snap' in selectionList[i]) {
  565. // }
  566. for (var j = 0; j < this.platformList.length; j++) {
  567. if (selectionList[i].platform === this.platformList[j].id) {
  568. selectionList[i].platform_icon = this.platformList[j].platform_icon
  569. }
  570. }
  571. // 佣金计算
  572. selectionList[i].price = selectionList[i].ProductInfo.ProductPrice
  573. console.table(selectionList[i].ProductInfo)
  574. selectionList[i].commission = selectionList[i].price * selectionList[i]
  575. .commission_rate * 0.01
  576. selectionList[i].show_commission = money(selectionList[i].commission) // 佣金比例
  577. selectionList[i].show_price = money(selectionList[i].price) // 售价
  578. selectionList[i].show_task_reward = money(selectionList[i].task_reward) // 任务悬赏
  579. // 判断是否到期
  580. selectionList[i].isFinished = this.isFinish(selectionList[i])
  581. // 判断是否有库存
  582. selectionList[i].isLacked = selectionList[i].remain_num == 0 ? true : false
  583. }
  584. this.selectionList.push(...selectionList);
  585. }
  586. });
  587. },
  588. isFinish(selection) {
  589. var timeNow = new Date();
  590. var ddl = new Date(selection.task_ddl.replace(/-/g, "/"));
  591. let remain_days = getDaysBetweenDates(timeNow, ddl);
  592. if (remain_days < 0) return true;
  593. else return false;
  594. },
  595. toggle4(type) {
  596. this.type4 = type
  597. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  598. this.$refs.popup4.open(type)
  599. // this.$refs.popup1.close()
  600. },
  601. // 保存图片
  602. async saveImage() {
  603. // showToast('保存成功')
  604. wx.downloadFile({
  605. url: this.kefuUrl,
  606. success: function(res) {
  607. wx.saveImageToPhotosAlbum({
  608. filePath: res.tempFilePath,
  609. success: function(data) {
  610. wx.showToast({
  611. title: "保存成功",
  612. icon: "success",
  613. duration: 2000
  614. })
  615. },
  616. fail: function(err) {
  617. console.log(err);
  618. },
  619. complete(res) {
  620. console.log(res);
  621. }
  622. })
  623. }
  624. })
  625. },
  626. closepop() {
  627. this.$refs.popup4.close()
  628. },
  629. xieyi() {
  630. console.log('进入联系我们')
  631. },
  632. pick(item) {
  633. console.log(item)
  634. uni.navigateTo({
  635. url: item.name
  636. });
  637. },
  638. }
  639. }
  640. </script>
  641. <style>
  642. /deep/ .share .uni-popup .uni-popup__wrapper {
  643. width: 80% !important;
  644. border-radius: 15rpx !important;
  645. }
  646. </style>
  647. <style lang="scss" scoped>
  648. //nav
  649. .nav {
  650. position: relative;
  651. }
  652. .nv_padding {
  653. height: 88upx;
  654. background-color: transparent;
  655. }
  656. /* 图标默认大小 */
  657. .nv_icon {
  658. width: 16px;
  659. height: 16px;
  660. }
  661. .bg_box {
  662. position: absolute;
  663. width: 750upx;
  664. height: 88upx;
  665. z-index: 10;
  666. top: 0;
  667. background-color: transparent;
  668. /* #ifdef MP */
  669. box-sizing: border-box;
  670. /* #endif */
  671. /* #ifndef APP-PLUS-NVUE */
  672. background-size: cover;
  673. background-repeat: no-repeat;
  674. background-position: center center;
  675. /* #endif */
  676. }
  677. .mys_navBar {
  678. /* #ifndef APP-PLUS-NVUE */
  679. display: flex;
  680. height: 88upx;
  681. /* #endif */
  682. // #ifdef MP
  683. box-sizing: border-box;
  684. // #endif
  685. width: 750upx;
  686. flex-direction: row;
  687. background-color: transparent;
  688. position: absolute;
  689. z-index: 10;
  690. top: 0;
  691. }
  692. .fixed {
  693. position: fixed;
  694. }
  695. /*
  696. left 按钮
  697. */
  698. .btn_type {
  699. /* #ifndef APP-PLUS-NVUE */
  700. display: flex;
  701. /* #endif */
  702. /* #ifdef APP-PLUS-NVUE */
  703. margin-left: 16upx;
  704. /* #endif */
  705. // #ifndef MP
  706. align-items: center;
  707. // #endif
  708. flex: 1;
  709. flex-direction: row;
  710. // background-color: #fff;
  711. }
  712. .btn_box {
  713. /* #ifndef APP-PLUS-NVUE */
  714. display: flex;
  715. margin-left: 16upx;
  716. /* #endif */
  717. flex-direction: row;
  718. // #ifndef MP
  719. align-items: center;
  720. // #endif
  721. }
  722. .btn_back,
  723. .btn_home {
  724. /* #ifndef APP-PLUS-NVUE */
  725. display: flex;
  726. /* #endif */
  727. /* #ifndef APP-PLUS-NVUE */
  728. height: 100%;
  729. /* #endif */
  730. /* #ifdef APP-PLUS-NVUE */
  731. width: 76upx;
  732. height: 62upx;
  733. /* #endif */
  734. flex-direction: row;
  735. align-items: center;
  736. justify-content: center;
  737. flex: 1;
  738. }
  739. /* 按钮类型1 */
  740. .nav_btn_t1 {
  741. /* #ifndef APP-PLUS-NVUE */
  742. display: flex;
  743. /* #endif */
  744. // #ifdef MP
  745. box-sizing: border-box;
  746. // #endif
  747. flex-direction: row;
  748. align-items: center;
  749. border-style: solid;
  750. border-width: 1px;
  751. border-color: #C0C0C0;
  752. // background-color: rgba(0, 0, 0, 0.2);
  753. background-color: #FFFFFF;
  754. width: 130upx;
  755. height: 45upx;
  756. }
  757. .line {
  758. width: 1upx;
  759. height: 60%;
  760. /* #ifdef APP-PLUS-NVUE */
  761. height: 30upx;
  762. /* #endif */
  763. background-color: #C0C0C0;
  764. }
  765. /*
  766. 标题
  767. */
  768. .title_container {
  769. /* #ifndef APP-PLUS-NVUE */
  770. display: flex;
  771. /* #endif */
  772. position: absolute;
  773. left: 375upx;
  774. bottom: 0;
  775. transform: translateX(-50%);
  776. flex-direction: row;
  777. justify-content: center;
  778. align-items: center;
  779. }
  780. .title_text {
  781. // flex: 1;
  782. text-overflow: ellipsis;
  783. /* #ifndef APP-PLUS-NVUE */
  784. white-space: nowrap;
  785. overflow: hidden;
  786. font-weight: 550;
  787. /* #endif */
  788. /* #ifdef APP-PLUS-NVUE */
  789. lines: 1;
  790. /* #endif */
  791. }
  792. /*
  793. 左边自定义
  794. */
  795. .my_left_box {
  796. /* #ifndef APP-PLUS-NVUE */
  797. display: flex;
  798. /* #endif */
  799. flex-direction: row;
  800. align-items: center;
  801. }
  802. .my_left_icon {
  803. /* #ifndef APP-PLUS-NVUE */
  804. display: flex;
  805. /* #endif */
  806. flex-direction: row;
  807. align-items: center;
  808. justify-content: center;
  809. /* #ifndef MP */
  810. margin-left: 18upx;
  811. /* #endif */
  812. }
  813. .my_left_custom {
  814. /* #ifndef APP-PLUS-NVUE */
  815. display: flex;
  816. /* #endif */
  817. flex-direction: row;
  818. align-items: center;
  819. // justify-content: center;
  820. }
  821. /* 文字 */
  822. .leftText {
  823. /* #ifndef APP-PLUS-NVUE */
  824. display: flex;
  825. /* #endif */
  826. flex-direction: row;
  827. align-items: center;
  828. justify-content: center;
  829. padding-left: 4upx;
  830. font-size: 15px;
  831. }
  832. /*
  833. 中间
  834. */
  835. .my_custom_box {
  836. /* #ifndef APP-PLUS-NVUE */
  837. display: flex;
  838. /* #endif */
  839. flex-direction: row;
  840. align-items: center;
  841. justify-content: center;
  842. flex: 1;
  843. }
  844. /*
  845. 搜索框
  846. */
  847. .nv_search_box {
  848. /* #ifndef APP-PLUS-NVUE */
  849. display: flex;
  850. /* #endif */
  851. flex-direction: row;
  852. align-items: center;
  853. flex: 1;
  854. /* #ifndef MP */
  855. height: 60upx;
  856. /* #endif */
  857. background-color: #f8f8f8;
  858. padding-right: 20upx;
  859. padding-left: 20upx;
  860. border-radius: 60upx;
  861. margin-right: 15upx;
  862. margin-left: 15upx;
  863. }
  864. .nv_input {
  865. flex: 1;
  866. padding-left: 16upx;
  867. font-size: 13px;
  868. }
  869. .close {
  870. width: 50upx;
  871. /* #ifndef APP-PLUS-NVUE */
  872. display: flex;
  873. /* #endif */
  874. flex-direction: row;
  875. align-items: center;
  876. justify-content: center;
  877. /* #ifndef MP */
  878. height: 62upx;
  879. /* #endif */
  880. }
  881. /*
  882. 右边 自定义
  883. */
  884. .my_right_icon {
  885. /* #ifndef APP-PLUS-NVUE */
  886. display: flex;
  887. /* #endif */
  888. flex-direction: row;
  889. align-items: center;
  890. justify-content: center;
  891. /* #ifndef MP */
  892. // min-width: 70upx;
  893. /* #endif */
  894. padding-left: 6px;
  895. padding-right: 10px;
  896. }
  897. .imge image {
  898. width: 100%;
  899. height: 260rpx;
  900. }
  901. </style>
  902. <style lang="scss" scoped>
  903. .option1 {
  904. padding: 5rpx 18rpx;
  905. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  906. width: 100rpx;
  907. text-align: center;
  908. }
  909. }
  910. .option2 {
  911. padding: 5rpx 18rpx;
  912. }
  913. .option3 {
  914. padding: 5rpx 18rpx;
  915. }
  916. .butmin {
  917. // height: 48rpx;
  918. width: 250rpx;
  919. background-color: #FCCF41;
  920. line-height: 48rpx;
  921. }
  922. .butmin1 {
  923. // height: 48rpx;
  924. width: 250rpx;
  925. background-color: #fff;
  926. border: #000000 1rpx solid;
  927. line-height: 48rpx;
  928. }
  929. //弹出层
  930. /deep/ .uni-data-checklist .checklist-group .checklist-box {
  931. background-color: #FFFFFF !important;
  932. border-radius: 20rpx !important;
  933. padding: 8rpx 30rpx !important;
  934. border: 0 !important;
  935. }
  936. /deep/ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
  937. font-size: 24rpx;
  938. color: #333333;
  939. }
  940. /deep/ .mini-btn {
  941. height: 70rpx;
  942. width: 250rpx;
  943. line-height: 70rpx;
  944. margin: 20rpx;
  945. letter-spacing: 4rpx;
  946. background-color: #FCCF41;
  947. }
  948. /deep/ .mini-btn1 {
  949. height: 70rpx;
  950. width: 400rpx;
  951. line-height: 70rpx;
  952. margin: 20rpx;
  953. letter-spacing: 4rpx;
  954. color: white;
  955. ;
  956. }
  957. /deep/ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
  958. background-color: #FCCF41 !important;
  959. }
  960. .butto {
  961. text-align: center;
  962. }
  963. .swiper {
  964. height: 300rpx;
  965. }
  966. .swiper-item {
  967. display: block;
  968. height: 300rpx;
  969. line-height: 300rpx;
  970. text-align: center;
  971. }
  972. .swiper-list {
  973. margin-top: 40rpx;
  974. margin-bottom: 0;
  975. }
  976. </style>
  977. <style lang="scss" scoped>
  978. .commodity {
  979. margin-top: 10rpx;
  980. display: flex;
  981. flex-wrap: wrap;
  982. justify-content: space-between;
  983. }
  984. .project {
  985. width: 49%;
  986. height: 550rpx;
  987. border-radius: 20rpx;
  988. margin-bottom: 0%;
  989. }
  990. .projectdiagram {
  991. width: 100%;
  992. height: 61%;
  993. background-size: 100% 100%;
  994. position: relative;
  995. border-radius: 10rpx;
  996. ;
  997. }
  998. .projecttext {
  999. // padding-top: 5%;
  1000. padding: 0 0 0 1%;
  1001. // height: 80rpx;
  1002. }
  1003. .projecttext span {
  1004. color: #333333;
  1005. font-size: 25rpx;
  1006. font-weight: 550;
  1007. text-indent: 2em;
  1008. }
  1009. .projecttext image {
  1010. vertical-align: middle;
  1011. width: 30rpx;
  1012. height: 30rpx;
  1013. display: inline-block;
  1014. margin-right: 14rpx;
  1015. }
  1016. .projectinfo {
  1017. display: flex;
  1018. justify-content: space-around;
  1019. }
  1020. .projectinfotxt {
  1021. display: flex;
  1022. flex-direction: column;
  1023. align-items: center;
  1024. justify-content: center;
  1025. }
  1026. .projectinfotxt p {
  1027. color: #767272;
  1028. font-size: 20rpx;
  1029. margin: 5rpx 0;
  1030. }
  1031. .projectinfotag {
  1032. display: flex;
  1033. justify-content: space-around;
  1034. align-items: center;
  1035. }
  1036. .TitleText {
  1037. // height: 30rpx;
  1038. width: 100rpx;
  1039. background-color: #f70606;
  1040. border-radius: 10rpx;
  1041. display: inline-block;
  1042. text-align: center;
  1043. // padding: 0rpx 10rpx 0rpx 10rpx;
  1044. margin-right: 6%;
  1045. line-height: 30rpx;
  1046. margin-top: 0%;
  1047. }
  1048. .TitleText p {
  1049. color: #fff;
  1050. font-size: 16rpx;
  1051. }
  1052. .Mask {
  1053. position: absolute;
  1054. background-color: #000000;
  1055. opacity: 0.6;
  1056. width: 100%;
  1057. height: 100%;
  1058. // z-index: 999;
  1059. text-align: center;
  1060. border-radius: 20rpx;
  1061. }
  1062. .Mask image {
  1063. width: 50%;
  1064. height: 52%;
  1065. padding-top: 25%;
  1066. }
  1067. .contt {
  1068. position: relative;
  1069. }
  1070. .contact {
  1071. position: fixed;
  1072. top: 80%;
  1073. right: 13%;
  1074. }
  1075. //弹窗
  1076. .sharepage {
  1077. // width: 90%;
  1078. margin: 0 auto;
  1079. // position: relative;
  1080. }
  1081. /deep/ .share.uni-popup .uni-popup__wrapper {
  1082. width: 70%;
  1083. border-radius: 15rpx;
  1084. }
  1085. .projecttext1 {
  1086. // padding-top: 5%;
  1087. padding: 0 0 0 1%;
  1088. height: 80rpx;
  1089. margin: 5% 0;
  1090. text-align: center;
  1091. }
  1092. .projecttext1 image {
  1093. vertical-align: middle;
  1094. width: 80rpx;
  1095. height: 80rpx;
  1096. display: inline-block;
  1097. padding-right: 14rpx;
  1098. }
  1099. .sharemap {
  1100. margin: 0 auto;
  1101. text-align: center;
  1102. // margin-top: 15%;
  1103. // margin-bottom: 15%;
  1104. }
  1105. .sharemap image {
  1106. width: 400rpx;
  1107. height: 400rpx;
  1108. }
  1109. .sharetxt {
  1110. height: 100rpx;
  1111. display: flex;
  1112. flex-direction: column;
  1113. align-items: center;
  1114. justify-content: center;
  1115. }
  1116. .sharetxt text {
  1117. font-size: 24rpx;
  1118. text-align: left;
  1119. line-height: 20rpx
  1120. }
  1121. .butmin {
  1122. // height: 48rpx;
  1123. width: 250rpx;
  1124. background-color: #FCCF41;
  1125. line-height: 48rpx;
  1126. }
  1127. .butmin1 {
  1128. // height: 48rpx;
  1129. width: 250rpx;
  1130. background-color: #fff;
  1131. border: #000000 1rpx solid;
  1132. line-height: 48rpx;
  1133. }
  1134. .share {
  1135. text-align: center;
  1136. line-height: 10rpx;
  1137. margin-top: 10rpx;
  1138. }
  1139. .share image {
  1140. vertical-align: middle;
  1141. width: 25rpx;
  1142. height: 25rpx;
  1143. display: inline-block
  1144. }
  1145. .share p {
  1146. // display: inline-block;
  1147. font-size: 24rpx;
  1148. // color: #333333;
  1149. }
  1150. .img1 {
  1151. width: 84rpx;
  1152. height: 124rpx;
  1153. position: absolute;
  1154. }
  1155. </style>