selectionsquare.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  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="option1" style="margin-top: 20%;">
  70. <h3 style="margin-bottom: 10rpx;font-weight: bold;"><strong>样品形式</strong></h3>
  71. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby1" :localdata="hobby1">
  72. </uni-data-checkbox>
  73. </view>
  74. <view class="option2">
  75. <h3 style="margin-bottom: 10rpx;font-weight: bold;">任务形式</h3>
  76. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby2" :localdata="hobby2">
  77. </uni-data-checkbox>
  78. </view>
  79. <view class="option3">
  80. <h3 style="margin-bottom: 10rpx;font-weight: bold;">商品类目</h3>
  81. <uni-data-checkbox mode="tag" multiple v-model="formData.hobby3" :localdata="hobby3">
  82. </uni-data-checkbox>
  83. </view>
  84. <view class="butto">
  85. <button class="mini-btn" size="mini" @tap="reset">重置</button>
  86. <button class="mini-btn" size="mini" @tap="submitSearch">确定</button>
  87. </view>
  88. </view>
  89. </uni-popup>
  90. </view>
  91. <!-- banner -->
  92. <view class="uni-margin-wrap">
  93. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay"
  94. :interval="interval" :duration="duration">
  95. <swiper-item v-for="item in list1" @click="pick(item)">
  96. <image :src="item.img" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
  97. </swiper-item>
  98. </swiper>
  99. </view>
  100. <!-- 商品卡片细节 -->
  101. <view class="commodity" style="margin-top: 3%;">
  102. <view class="project" v-for="(item,index) in selectionList" :key="index" @tap="toDetail(item)">
  103. <!-- 主图 -->
  104. <view class="projectdiagram" :style="{backgroundImage:`url(${item.coverphoto})`}">
  105. <view class="Mask" v-if="item.isFinished">
  106. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home4.png" mode="">
  107. </image>
  108. </view>
  109. <view v-else>
  110. <view class="Mask" v-if="item.isLacked">
  111. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent_upload/lack.png"
  112. mode="">
  113. </image>
  114. </view>
  115. </view>
  116. <view style="padding-left: 4%;padding-top: 2%;">
  117. </view>
  118. </view>
  119. <!-- 项目信息1 -->
  120. <view class="section">
  121. <view class="section1">
  122. <p>佣金:{{item.exclusive_commission}}%</p>
  123. </view>
  124. <view class="section2" v-if="item.task_mode == 1">
  125. <p>额外悬赏:¥{{item.show_task_reward}}</p>
  126. </view>
  127. </view>
  128. <!-- 平台logo、项目名称 -->
  129. <view class="projecttext">
  130. <image :src="item.platform_icon">
  131. </image>
  132. <span>{{item.selection_name|ellipsis}}</span>
  133. </view>
  134. <!-- 项目信息2 -->
  135. <view class="projectinfo">
  136. <view class="projectinfotxt">
  137. <p>预估赚:<span style="color: red;">¥{{item.show_earn}}</span></p>
  138. </view>
  139. <view class="projectinfotxt">
  140. <p>售价:<span style="color: red;">¥{{item.price}}</span></p>
  141. </view>
  142. </view>
  143. <!-- 项目信息3 -->
  144. <view class="projectinfo" style="justify-content: space-between;">
  145. <view class="projectinfotag">
  146. <view class="TitleText" v-if="item.sample_mode == 1">
  147. <p>免费领</p>
  148. </view>
  149. <view class="TitleText" style="background-color: #fcca00;" v-if="item.sample_mode !== 1">
  150. <p>查看</p>
  151. </view>
  152. </view>
  153. <view class="projectinfotxt" style="margin: 0 10rpx;" v-if="item.sample_mode == 1">
  154. <p>余<span style="color: #52b2f0;">{{item.remain_num}}</span>件</p>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <!-- 普通弹窗 公众号-->
  160. <uni-popup ref="popup4" class="share" background-color="#fff" :maskClick="false">
  161. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
  162. <view class="sharepage">
  163. <view class="projecttext1">
  164. <image src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/younggee_logo.png"
  165. style="width: 250rpx; height: 80rpx;" mode=""></image>
  166. <!-- <span>YoungGee</span> -->
  167. </view>
  168. <view class="sharemap">
  169. <image :src="kefuUrl" style="width: 400rpx;height: 400rpx;" mode=""></image>
  170. </view>
  171. <view style="margin: 30rpx 0;">
  172. <button class="butmin1" size="mini" @tap="saveImage">保存二维码</button>
  173. </view>
  174. <view class="sharetxt">
  175. <text>
  176. 使用样叽的过程中,有任何疑问,\n
  177. 请添加上方微信。\n
  178. 我们保证及时全力为您解决!
  179. </text>
  180. </view>
  181. <view style="margin: 30rpx 0;">
  182. <button class="butmin" size="mini" @tap="closepop">知道了</button>
  183. </view>
  184. </view>
  185. </view>
  186. </uni-popup>
  187. <view class="contact" @click="toggle4('center')">
  188. <view class="contt">
  189. <!-- <image class="img2" src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home2.png" mode=""></image> -->
  190. <image class="img1"
  191. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu_20211124192542.png" mode="">
  192. </image>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </template>
  199. <script>
  200. import aTip from "@/components/mys-tip_1.0.01/a_tip/aTip";
  201. import {
  202. getQueryString,
  203. fansview,
  204. money,
  205. getDaysBetweenDates,
  206. getDaysAndHoursBetweenDates
  207. } from '@/components/utils.js';
  208. import {
  209. saveImageToPhotosAlbum,
  210. showToast,
  211. downloadFile
  212. } from '@/uni_modules/sakura-canvas/js_sdk/util'
  213. export default {
  214. // 父组件向子组件传值 props
  215. props: {
  216. mysNavConfig: {
  217. type: Object,
  218. default () {
  219. return {
  220. /* 固定导航 */
  221. navFixed: true,
  222. /* 开启单页显示首页图标 */
  223. isHome: true,
  224. /* 占位开启 */
  225. navPadding: true,
  226. /* 背景 */
  227. bgColor: "#f8f8f8",
  228. /* 渐变色 */
  229. opacity: 1,
  230. /* 渐变开启 */
  231. isOpacity: false,
  232. /* 渐变延时效果 */
  233. opacityTime: 100,
  234. /* 左侧按钮样式 可选 type1 type2 (type2根据小程序胶囊位置调整) */
  235. btnType: "type1",
  236. /* type1 左侧文字配置 */
  237. leftText: {
  238. text: "",
  239. color: "",
  240. fontSize: "16px", // px upx rpx
  241. fontWeight: "", // blod
  242. },
  243. /* 标题 */
  244. navTitle: {
  245. text: "带货",
  246. color: "",
  247. fontSize: "32rpx", // px upx rpx
  248. fontWeight: "normal", // blod
  249. },
  250. /* type2 按钮 */
  251. type2Config: {
  252. // 左图标
  253. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png3.png",
  254. // 右图标
  255. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png1.png",
  256. // 圆角
  257. radius: "40rpx",
  258. },
  259. };
  260. },
  261. },
  262. scrollTop: {
  263. type: Number,
  264. default: function() {
  265. return 0;
  266. },
  267. },
  268. },
  269. filters: {
  270. ellipsis(value) {
  271. if (!value) return "";
  272. if (value.length > 20) {
  273. return value.slice(0, 20) + "...";
  274. }
  275. return value;
  276. },
  277. },
  278. components: {
  279. aTip
  280. },
  281. data() {
  282. return {
  283. // nav
  284. navH: getApp().globalData.navHeight,
  285. kefuUrl: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/kefu.jpeg",
  286. iconW: undefined,
  287. iconH: undefined,
  288. btnWidth: undefined,
  289. btnHeight: undefined,
  290. navBarTop: undefined,
  291. navBarHeight: undefined,
  292. navBarLeft: undefined,
  293. navBarRight: undefined,
  294. inputHeight: undefined,
  295. // banner
  296. indicatorDots: true,
  297. autoplay: true,
  298. interval: 3000,
  299. duration: 1000,
  300. // 旧多选框
  301. /*formData: {
  302. hobby: [],
  303. hobby1: [],
  304. hobby2: [],
  305. },
  306. hobby: [{
  307. text: '红book',
  308. value: 1
  309. }, {
  310. text: '抖音',
  311. value: 2
  312. }, {
  313. text: '微博',
  314. value: 3
  315. }, {
  316. text: '快手',
  317. value: 4
  318. }, {
  319. text: 'B站',
  320. value: 5
  321. }, {
  322. text: '大众点评',
  323. value: 6
  324. }, {
  325. text: '知乎',
  326. value: 7
  327. }],
  328. hobby1: [{
  329. text: '免费领样',
  330. value: 1
  331. }, {
  332. text: '垫付后返',
  333. value: 2
  334. }, {
  335. text: '不提供样品',
  336. value: 3
  337. }],
  338. hobby2: [{
  339. text: '悬赏任务',
  340. value: 1
  341. }, {
  342. text: '纯佣带货',
  343. value: 2
  344. }], */
  345. // 多选框
  346. formData: {
  347. hobby1: [], //样品形式
  348. hobby2: [], //任务形式
  349. hobby3: [], //商品类目
  350. },
  351. //平台种类直接从表中获得,此版本中只有抖音平台
  352. hobby: [],
  353. hobby1: [{
  354. text: '免费领样',
  355. value: 1
  356. }, {
  357. text: '不提供样品',
  358. value: 3
  359. }],
  360. hobby2: [{
  361. text: '悬赏任务',
  362. value: 1
  363. }, {
  364. text: '纯佣带货',
  365. value: 2
  366. }],
  367. hobby3: [{
  368. text: '智能家居',
  369. value: 1
  370. }, {
  371. text: '食品饮料',
  372. value: 2
  373. }, {
  374. text: '珠宝文玩',
  375. value: 3
  376. }, {
  377. text: ' 奢侈品',
  378. value: 4
  379. }, {
  380. text: '个户家清',
  381. value: 5
  382. }, {
  383. text: '礼品文创',
  384. value: 6
  385. }, {
  386. text: '\u3000生鲜\u3000',
  387. value: 7
  388. }, {
  389. text: '农资绿植',
  390. value: 8
  391. }, {
  392. text: '本地生活',
  393. value: 9
  394. }, {
  395. text: '钟表配饰',
  396. value: 10
  397. }, {
  398. text: '玩具乐器',
  399. value: 11
  400. }, {
  401. text: '二手闲置',
  402. value: 12
  403. }, {
  404. text: '服饰内衣',
  405. value: 13
  406. }, {
  407. text: '\u3000美妆\u3000',
  408. value: 14
  409. }, {
  410. text: '数码家电',
  411. value: 15
  412. }, {
  413. text: '图书教育',
  414. value: 16
  415. }, {
  416. text: '鞋靴箱包',
  417. value: 17
  418. }, {
  419. text: '母婴宠物',
  420. value: 18
  421. }, {
  422. text: '虚拟充值',
  423. value: 19
  424. }, {
  425. text: '户外运动',
  426. value: 20
  427. }],
  428. list1: [{
  429. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home1.png',
  430. name: '/page_tasksquare/banner/guide'
  431. },
  432. {
  433. img: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home7.png',
  434. name: '/page_tasksquare/banner/cooperation'
  435. }
  436. ],
  437. per: 0,
  438. max_page: 0,
  439. filtCondition: '',
  440. selectionList: [],
  441. product: {},
  442. younggeeProductPhoto: {},
  443. }
  444. },
  445. watch: {
  446. scrollTop(val) {
  447. if (!this.mysNavConfig.isOpacity) {
  448. return;
  449. }
  450. this.setOpacity(val, this.mysNavConfig.opacityTime);
  451. },
  452. },
  453. created() {
  454. this.init();
  455. },
  456. //onshow生命周期执行完之后,this内部就有了很多内容
  457. async onShow() {
  458. this.isLoginApi()
  459. await this.getInfoListApi()
  460. this.per = 0
  461. this.selectionList = []
  462. this.getSelectionListApi()
  463. },
  464. async onLoad() {},
  465. //下拉刷新
  466. onPullDownRefresh() {
  467. this.per = 0
  468. this.selectionList = []
  469. this.getSelectionListApi()
  470. //停止下拉刷新
  471. uni.stopPullDownRefresh()
  472. },
  473. // 下拉懒加载
  474. async onReachBottom() {
  475. ++this.per;
  476. if (this.per >= this.max_page) {
  477. uni.showToast({
  478. title: "已加载全部"
  479. })
  480. } else {
  481. uni.showLoading({
  482. title: '加载中'
  483. })
  484. await this.getSelectionListApi()
  485. uni.hideLoading();
  486. }
  487. },
  488. methods: {
  489. /**
  490. * @param scrollTop 页面顶部距离
  491. * @param down 滑动显示效果延时
  492. */
  493. setOpacity(scrollTop, down = 60) {
  494. if (scrollTop > 0) {
  495. if (scrollTop < down) {
  496. this.opacity = scrollTop / down;
  497. }
  498. if (scrollTop > down) {
  499. this.opacity = 1;
  500. }
  501. } else {
  502. this.opacity = 0;
  503. }
  504. },
  505. /* type2 点击分类 */
  506. onLeftHome(type) {
  507. this.type = type
  508. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  509. this.$refs.popup.open(type)
  510. },
  511. init() {
  512. if (this.mysNavConfig.isHome) {
  513. let pages = getCurrentPages().length;
  514. /* 单页显示home图标 */
  515. pages === 1 ? (this.isHome = true) : (this.isHome = false);
  516. }
  517. // 开启渐变 强制fixed
  518. this.navBarTop = uni.getSystemInfoSync().statusBarHeight +
  519. "px";
  520. if (!this.mysNavConfig.opacity) {
  521. this.opacity = 1;
  522. !this.mysNavConfig.isOpacity ? (this.opacity = 1) : ((this
  523. .mysNavConfig.navFixed = true), (this
  524. .opacity = 0));
  525. } else {
  526. this.opacity = this.mysNavConfig.opacity;
  527. !this.mysNavConfig.isOpacity ? "" : ((this.mysNavConfig
  528. .navFixed = true), (this.opacity = 0));
  529. }
  530. // #ifdef MP
  531. this.initMP();
  532. // #endif
  533. // #ifdef APP-PLUS-NVUE
  534. this.navBarHeight = 44 + uni.getSystemInfoSync()
  535. .statusBarHeight + "px";
  536. // #endif
  537. },
  538. /* 小程序初始化位置 */
  539. initMP() {
  540. // getSystemInfoSync用于获取系统信息同步接口
  541. let gS = uni.getSystemInfoSync();
  542. // getMenuButtonBoundingClientRect用于获取胶囊按钮位置布局信息
  543. let rect = uni.getMenuButtonBoundingClientRect();
  544. let rectHeight = rect.height;
  545. this.btnWidth = rect.width + "px";
  546. this.btnHeight = rectHeight + "px";
  547. this.iconW = Math.floor(rect.width / 4 - 5) + "px";
  548. this.iconH = rectHeight / 2 + "px";
  549. this.inputHeight = rectHeight - 3 + "px";
  550. this.navBarTop = rect.top + "px";
  551. this.navBarLeft = gS.screenWidth - rect.right + "px";
  552. this.navBarRight = gS.screenWidth - rect.right + rect.width +
  553. "px";
  554. this.navBarHeight = gS.statusBarHeight + rectHeight + (rect
  555. .top - gS.statusBarHeight) * 2 + "px";
  556. },
  557. toDetail(item) {
  558. console.log("item:", item)
  559. uni.navigateTo({
  560. url: '/page_selectionsquare/selectiondetail/selectiondetail?id=' + item.selection_id +
  561. '&pid=' + item.YounggeeProduct[0].product_id
  562. });
  563. },
  564. async submitSearch() {
  565. //被选中的hobby才会加入数据中,加入的是value数字
  566. console.log('look-----', this.formData.hobby1)
  567. console.log('look-----333333', this.formData.hobby3)
  568. this.per = 0;
  569. this.$refs.popup.close()
  570. var filtCondition = ''
  571. //各平台名字展示
  572. // for (var i = 0; i < this.formData.hobby.length; i++) {
  573. // filtCondition += "&platform[]" + "=" + this.formData.hobby[i]
  574. // }
  575. //"&secform[]=" 是一个固定的字符串部分,用来表示参数格式
  576. //最后参数形如&secform[]=2&secform[]=3&secform[]=9
  577. //样品形式
  578. for (var j = 0; j < this.formData.hobby1.length; j++) {
  579. filtCondition += "&secform[]" + "=" + this.formData.hobby1[j]
  580. }
  581. //任务形式
  582. for (var j = 0; j < this.formData.hobby2.length; j++) {
  583. filtCondition += "&taskform[]" + "=" + this.formData.hobby2[j]
  584. }
  585. //商品类目
  586. for (var j = 0; j < this.formData.hobby3.length; j++) {
  587. filtCondition += "&categoryform[]" + "=" + this.formData.hobby3[j]
  588. }
  589. this.filtCondition = filtCondition
  590. uni.showLoading({
  591. title: '加载中'
  592. });
  593. this.selectionList = []
  594. await this.getSelectionListApi()
  595. uni.hideLoading();
  596. },
  597. async reset() {
  598. this.per = 0;
  599. this.$refs.popup.close()
  600. this.formData.hobby1 = [];
  601. this.formData.hobby2 = [];
  602. this.formData.hobby3 = [];
  603. this.filtCondition = '';
  604. uni.showLoading({
  605. title: '加载中'
  606. });
  607. this.selectionList = []
  608. await this.getSelectionListApi()
  609. uni.hideLoading();
  610. },
  611. /* 点击左侧 */
  612. onLeftClick() {
  613. uni.navigateTo({
  614. url: '/page_selectionsquare/search'
  615. });
  616. },
  617. isLoginApi() {
  618. return this.$https.get('/youngee/c/t/g/is-login')
  619. .then(res => {
  620. if (res.data.code === 403) {
  621. // 登陆已失效
  622. this.token = ""
  623. uni.clearStorage();
  624. } else {
  625. this.token = uni.getStorageSync('token')
  626. }
  627. })
  628. },
  629. //获取一些info表中的信息----包含thirdplatform
  630. //res是一个包含服务器响应的对象
  631. getInfoListApi() {
  632. return this.$http.get('/youngee/c/g/get-info-tables')
  633. .then(res => {
  634. this.hobby = []
  635. this.platformList = res.data.data.ThirdPlatform
  636. let l = this.platformList != null ? this.platformList.length : 0;
  637. for (var i = 0; i < l; i++) {
  638. var obj = {}
  639. obj.text = this.platformList[i].platform_name
  640. obj.value = this.platformList[i].id
  641. this.hobby.push(obj)
  642. }
  643. })
  644. },
  645. getSelectionListApi() {
  646. //idx:当前页 cnt:每页展示个数
  647. return this.$http.get('/youngee/c/g/get-selection-list' +
  648. "?" +
  649. "idx" +
  650. "=" +
  651. this.per +
  652. "&cnt" +
  653. "=" +
  654. 20 + this.filtCondition
  655. //请求发送后,使用 .then() 方法处理响应结果 res。
  656. ).then(res => {
  657. if (res.data.code === 0) {
  658. console.log("res is here------->: ", res)
  659. // 获取res返回数据
  660. this.max_page = res.data.data.max_page
  661. console.log("res")
  662. let selectionList = res.data.data.SelectionDetail
  663. const count = res.data.data.count
  664. // 数据处理
  665. if (selectionList === null) {
  666. return
  667. }
  668. for (var i = 0; i < selectionList.length; i++) {
  669. console.log("**** selectionList[i]****", selectionList[i])
  670. this.product = selectionList[i].YounggeeProduct[0]
  671. this.younggeeProductPhoto = selectionList[i].YounggeeProductPhoto
  672. for (let j = 0; j < this.younggeeProductPhoto.length; ++j) {
  673. //1为主图,2为详情图,3为视频 selectionList[i]就是item
  674. if (this.younggeeProductPhoto[j].symbol == 1) {
  675. selectionList[i].coverphoto = this.younggeeProductPhoto[j].photo_url
  676. }
  677. }
  678. for (var k = 0; k < this.platformList.length; k++) {
  679. if (selectionList[i].platform === this.platformList[k].id) {
  680. selectionList[i].platform_icon = this.platformList[k].platform_icon
  681. }
  682. }
  683. //打印商品详情表
  684. console.log(selectionList[i])
  685. // 商品价格
  686. selectionList[i].price = this.product.product_price
  687. //高佣
  688. selectionList[i].exclusive_commission = this.product.exclusive_commission
  689. //预估赚
  690. selectionList[i].show_earn = this.product.commission_price
  691. //额外悬赏
  692. if (selectionList[i].task_mode == 1) {
  693. selectionList[i].show_task_reward = selectionList[i].RewardStrategy[0].per_reward
  694. }
  695. // 判断是否到期
  696. selectionList[i].isFinished = this.isFinish(selectionList[i])
  697. // 判断是否有库存
  698. selectionList[i].isLacked = selectionList[i].remain_num == 0 ? true : false
  699. }
  700. //...selectionList 是扩展运算符的语法,它会将 selectionList 数组中的所有元素展开,并作为单独的参数传递给 push() 方法
  701. //用于在原有数据的基础上添加新的数据
  702. this.selectionList.push(...selectionList);
  703. }
  704. });
  705. },
  706. isFinish(selection) {
  707. var timeNow = new Date();
  708. var ddl = new Date(selection.task_ddl.replace(/-/g, "/"));
  709. var diff = getDaysAndHoursBetweenDates(timeNow, ddl);
  710. let remain_days = diff.days;
  711. let remain_hours = diff.hours;
  712. if (remain_days <= 0 & remain_hours <= 0) return true;
  713. // let remain_days = getDaysBetweenDates(timeNow, ddl);
  714. // if (remain_days < 0) return true;
  715. else return false;
  716. },
  717. toggle4(type) {
  718. this.type4 = type
  719. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  720. this.$refs.popup4.open(type)
  721. // this.$refs.popup1.close()
  722. },
  723. // 保存图片
  724. async saveImage() {
  725. // showToast('保存成功')
  726. wx.downloadFile({
  727. url: this.kefuUrl,
  728. success: function(res) {
  729. wx.saveImageToPhotosAlbum({
  730. filePath: res.tempFilePath,
  731. success: function(data) {
  732. wx.showToast({
  733. title: "保存成功",
  734. icon: "success",
  735. duration: 2000
  736. })
  737. },
  738. fail: function(err) {
  739. console.log(err);
  740. },
  741. complete(res) {
  742. console.log(res);
  743. }
  744. })
  745. }
  746. })
  747. },
  748. closepop() {
  749. this.$refs.popup4.close()
  750. },
  751. xieyi() {
  752. console.log('进入联系我们')
  753. },
  754. pick(item) {
  755. console.log(item)
  756. uni.navigateTo({
  757. url: item.name
  758. });
  759. },
  760. }
  761. }
  762. </script>
  763. <style>
  764. /deep/ .share .uni-popup .uni-popup__wrapper {
  765. width: 80% !important;
  766. border-radius: 15rpx !important;
  767. }
  768. </style>
  769. <style lang="scss" scoped>
  770. //nav
  771. .nav {
  772. position: relative;
  773. }
  774. .nv_padding {
  775. height: 88upx;
  776. background-color: transparent;
  777. }
  778. /* 图标默认大小 */
  779. .nv_icon {
  780. width: 16px;
  781. height: 16px;
  782. }
  783. .bg_box {
  784. position: absolute;
  785. width: 750upx;
  786. height: 88upx;
  787. z-index: 10;
  788. top: 0;
  789. background-color: transparent;
  790. /* #ifdef MP */
  791. box-sizing: border-box;
  792. /* #endif */
  793. /* #ifndef APP-PLUS-NVUE */
  794. background-size: cover;
  795. background-repeat: no-repeat;
  796. background-position: center center;
  797. /* #endif */
  798. }
  799. .mys_navBar {
  800. /* #ifndef APP-PLUS-NVUE */
  801. display: flex;
  802. height: 88upx;
  803. /* #endif */
  804. // #ifdef MP
  805. box-sizing: border-box;
  806. // #endif
  807. width: 750upx;
  808. flex-direction: row;
  809. background-color: transparent;
  810. position: absolute;
  811. z-index: 10;
  812. top: 0;
  813. }
  814. .fixed {
  815. position: fixed;
  816. }
  817. /*
  818. left 按钮
  819. */
  820. .btn_type {
  821. /* #ifndef APP-PLUS-NVUE */
  822. display: flex;
  823. /* #endif */
  824. /* #ifdef APP-PLUS-NVUE */
  825. margin-left: 16upx;
  826. /* #endif */
  827. // #ifndef MP
  828. align-items: center;
  829. // #endif
  830. flex: 1;
  831. flex-direction: row;
  832. // background-color: #fff;
  833. }
  834. .btn_box {
  835. /* #ifndef APP-PLUS-NVUE */
  836. display: flex;
  837. margin-left: 16upx;
  838. /* #endif */
  839. flex-direction: row;
  840. // #ifndef MP
  841. align-items: center;
  842. // #endif
  843. }
  844. .btn_back,
  845. .btn_home {
  846. /* #ifndef APP-PLUS-NVUE */
  847. display: flex;
  848. /* #endif */
  849. /* #ifndef APP-PLUS-NVUE */
  850. height: 100%;
  851. /* #endif */
  852. /* #ifdef APP-PLUS-NVUE */
  853. width: 76upx;
  854. height: 62upx;
  855. /* #endif */
  856. flex-direction: row;
  857. align-items: center;
  858. justify-content: center;
  859. flex: 1;
  860. }
  861. /* 按钮类型1 */
  862. .nav_btn_t1 {
  863. /* #ifndef APP-PLUS-NVUE */
  864. display: flex;
  865. /* #endif */
  866. // #ifdef MP
  867. box-sizing: border-box;
  868. // #endif
  869. flex-direction: row;
  870. align-items: center;
  871. border-style: solid;
  872. border-width: 1px;
  873. border-color: #C0C0C0;
  874. // background-color: rgba(0, 0, 0, 0.2);
  875. background-color: #FFFFFF;
  876. width: 130upx;
  877. height: 45upx;
  878. }
  879. .line {
  880. width: 1upx;
  881. height: 60%;
  882. /* #ifdef APP-PLUS-NVUE */
  883. height: 30upx;
  884. /* #endif */
  885. background-color: #C0C0C0;
  886. }
  887. /*
  888. 标题
  889. */
  890. .title_container {
  891. /* #ifndef APP-PLUS-NVUE */
  892. display: flex;
  893. /* #endif */
  894. position: absolute;
  895. left: 375upx;
  896. bottom: 0;
  897. transform: translateX(-50%);
  898. flex-direction: row;
  899. justify-content: center;
  900. align-items: center;
  901. }
  902. .title_text {
  903. // flex: 1;
  904. text-overflow: ellipsis;
  905. /* #ifndef APP-PLUS-NVUE */
  906. white-space: nowrap;
  907. overflow: hidden;
  908. font-weight: 550;
  909. /* #endif */
  910. /* #ifdef APP-PLUS-NVUE */
  911. lines: 1;
  912. /* #endif */
  913. }
  914. /*
  915. 左边自定义
  916. */
  917. .my_left_box {
  918. /* #ifndef APP-PLUS-NVUE */
  919. display: flex;
  920. /* #endif */
  921. flex-direction: row;
  922. align-items: center;
  923. }
  924. .my_left_icon {
  925. /* #ifndef APP-PLUS-NVUE */
  926. display: flex;
  927. /* #endif */
  928. flex-direction: row;
  929. align-items: center;
  930. justify-content: center;
  931. /* #ifndef MP */
  932. margin-left: 18upx;
  933. /* #endif */
  934. }
  935. .my_left_custom {
  936. /* #ifndef APP-PLUS-NVUE */
  937. display: flex;
  938. /* #endif */
  939. flex-direction: row;
  940. align-items: center;
  941. // justify-content: center;
  942. }
  943. /* 文字 */
  944. .leftText {
  945. /* #ifndef APP-PLUS-NVUE */
  946. display: flex;
  947. /* #endif */
  948. flex-direction: row;
  949. align-items: center;
  950. justify-content: center;
  951. padding-left: 4upx;
  952. font-size: 15px;
  953. }
  954. /*
  955. 中间
  956. */
  957. .my_custom_box {
  958. /* #ifndef APP-PLUS-NVUE */
  959. display: flex;
  960. /* #endif */
  961. flex-direction: row;
  962. align-items: center;
  963. justify-content: center;
  964. flex: 1;
  965. }
  966. /*
  967. 搜索框
  968. */
  969. .nv_search_box {
  970. /* #ifndef APP-PLUS-NVUE */
  971. display: flex;
  972. /* #endif */
  973. flex-direction: row;
  974. align-items: center;
  975. flex: 1;
  976. /* #ifndef MP */
  977. height: 60upx;
  978. /* #endif */
  979. background-color: #f8f8f8;
  980. padding-right: 20upx;
  981. padding-left: 20upx;
  982. border-radius: 60upx;
  983. margin-right: 15upx;
  984. margin-left: 15upx;
  985. }
  986. .nv_input {
  987. flex: 1;
  988. padding-left: 16upx;
  989. font-size: 13px;
  990. }
  991. .close {
  992. width: 50upx;
  993. /* #ifndef APP-PLUS-NVUE */
  994. display: flex;
  995. /* #endif */
  996. flex-direction: row;
  997. align-items: center;
  998. justify-content: center;
  999. /* #ifndef MP */
  1000. height: 62upx;
  1001. /* #endif */
  1002. }
  1003. /*
  1004. 右边 自定义
  1005. */
  1006. .my_right_icon {
  1007. /* #ifndef APP-PLUS-NVUE */
  1008. display: flex;
  1009. /* #endif */
  1010. flex-direction: row;
  1011. align-items: center;
  1012. justify-content: center;
  1013. /* #ifndef MP */
  1014. // min-width: 70upx;
  1015. /* #endif */
  1016. padding-left: 6px;
  1017. padding-right: 10px;
  1018. }
  1019. .imge image {
  1020. width: 100%;
  1021. height: 260rpx;
  1022. }
  1023. </style>
  1024. <style lang="scss" scoped>
  1025. .option1 {
  1026. padding: 5rpx 18rpx;
  1027. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  1028. text-align: center;
  1029. }
  1030. }
  1031. .option2 {
  1032. padding: 5rpx 18rpx;
  1033. }
  1034. .option3 {
  1035. padding: 5rpx 18rpx;
  1036. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  1037. // width: 120rpx;
  1038. text-align: center;
  1039. }
  1040. }
  1041. .butmin {
  1042. // height: 48rpx;
  1043. width: 250rpx;
  1044. background-color: #FCCF41;
  1045. line-height: 48rpx;
  1046. }
  1047. .butmin1 {
  1048. // height: 48rpx;
  1049. width: 250rpx;
  1050. background-color: #fff;
  1051. border: #000000 1rpx solid;
  1052. line-height: 48rpx;
  1053. }
  1054. //弹出层
  1055. /deep/ .uni-data-checklist .checklist-group .checklist-box {
  1056. background-color: #FFFFFF !important;
  1057. border-radius: 20rpx !important;
  1058. padding: 8rpx 30rpx !important;
  1059. border: 0 !important;
  1060. }
  1061. /deep/ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
  1062. font-size: 24rpx;
  1063. color: #333333;
  1064. }
  1065. /deep/ .mini-btn {
  1066. height: 70rpx;
  1067. width: 250rpx;
  1068. line-height: 70rpx;
  1069. margin: 20rpx;
  1070. letter-spacing: 4rpx;
  1071. background-color: #FCCF41;
  1072. }
  1073. /deep/ .mini-btn1 {
  1074. height: 70rpx;
  1075. width: 400rpx;
  1076. line-height: 70rpx;
  1077. margin: 20rpx;
  1078. letter-spacing: 4rpx;
  1079. color: white;
  1080. ;
  1081. }
  1082. /deep/ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
  1083. background-color: #FCCF41 !important;
  1084. }
  1085. .butto {
  1086. text-align: center;
  1087. }
  1088. .swiper {
  1089. height: 300rpx;
  1090. }
  1091. .swiper-item {
  1092. display: block;
  1093. height: 300rpx;
  1094. line-height: 300rpx;
  1095. text-align: center;
  1096. }
  1097. .swiper-list {
  1098. margin-top: 40rpx;
  1099. margin-bottom: 0;
  1100. }
  1101. </style>
  1102. <style lang="scss" scoped>
  1103. .commodity {
  1104. margin-top: 10rpx;
  1105. display: flex;
  1106. flex-wrap: wrap;
  1107. justify-content: space-between;
  1108. }
  1109. .project {
  1110. width: 49%;
  1111. height: 550rpx;
  1112. border-radius: 20rpx;
  1113. margin-bottom: 4%;
  1114. }
  1115. .projectdiagram {
  1116. width: 100%;
  1117. height: 61%;
  1118. background-size: 100% 100%;
  1119. position: relative;
  1120. border-radius: 10rpx;
  1121. ;
  1122. }
  1123. .projecttext {
  1124. // padding-top: 5%;
  1125. padding: 0 0 0 1%;
  1126. // height: 80rpx;
  1127. }
  1128. .projecttext span {
  1129. color: #333333;
  1130. font-size: 25rpx;
  1131. font-weight: 550;
  1132. text-indent: 2em;
  1133. }
  1134. .projecttext image {
  1135. vertical-align: middle;
  1136. width: 30rpx;
  1137. height: 30rpx;
  1138. display: inline-block;
  1139. margin-right: 14rpx;
  1140. }
  1141. .projectinfo {
  1142. display: flex;
  1143. justify-content: space-between;
  1144. margin-top: 5%;
  1145. }
  1146. .projectinfotxt {
  1147. display: flex;
  1148. flex-direction: column;
  1149. align-items: center;
  1150. justify-content: center;
  1151. }
  1152. .projectinfotxt p {
  1153. color: #767272;
  1154. font-size: 20rpx;
  1155. margin: 5rpx 0;
  1156. }
  1157. .projectinfotag {
  1158. display: flex;
  1159. justify-content: space-around;
  1160. align-items: center;
  1161. }
  1162. // 美化背景色
  1163. .section {
  1164. display: flex;
  1165. align-items: center;
  1166. justify-content: space-between;
  1167. font-size: 20rpx;
  1168. margin: 6rpx 0;
  1169. color: #ffffff;
  1170. }
  1171. .section1 {
  1172. background-image: linear-gradient(to top, #c54529, #e38e3e);
  1173. border-radius: 8px;
  1174. width: 140rpx;
  1175. height: 45rpx;
  1176. text-align: center;
  1177. line-height: 40rpx;
  1178. }
  1179. .section2 {
  1180. background-image: linear-gradient(to top, #6991e1, #db9c53);
  1181. border-radius: 8px;
  1182. width: 200rpx;
  1183. height: 45rpx;
  1184. text-align: center;
  1185. line-height: 40rpx;
  1186. }
  1187. .TitleText {
  1188. // height: 30rpx;
  1189. width: 120rpx;
  1190. height: 45rpx;
  1191. background-color: #f70606;
  1192. border-radius: 20rpx;
  1193. display: inline-block;
  1194. text-align: center;
  1195. // padding: 0rpx 10rpx 0rpx 10rpx;
  1196. margin-right: 6%;
  1197. line-height: 42rpx;
  1198. }
  1199. .TitleText p {
  1200. color: #fff;
  1201. font-size: 20rpx;
  1202. }
  1203. .Mask {
  1204. position: absolute;
  1205. background-color: #000000;
  1206. opacity: 0.6;
  1207. width: 100%;
  1208. height: 100%;
  1209. // z-index: 999;
  1210. text-align: center;
  1211. border-radius: 20rpx;
  1212. }
  1213. .Mask image {
  1214. width: 50%;
  1215. height: 52%;
  1216. padding-top: 25%;
  1217. }
  1218. .contt {
  1219. position: relative;
  1220. }
  1221. .contact {
  1222. position: fixed;
  1223. top: 80%;
  1224. right: 13%;
  1225. }
  1226. //弹窗
  1227. .sharepage {
  1228. // width: 90%;
  1229. margin: 0 auto;
  1230. // position: relative;
  1231. }
  1232. /deep/ .share.uni-popup .uni-popup__wrapper {
  1233. width: 70%;
  1234. border-radius: 15rpx;
  1235. }
  1236. .projecttext1 {
  1237. // padding-top: 5%;
  1238. padding: 0 0 0 1%;
  1239. height: 80rpx;
  1240. margin: 5% 0;
  1241. text-align: center;
  1242. }
  1243. .projecttext1 image {
  1244. vertical-align: middle;
  1245. width: 80rpx;
  1246. height: 80rpx;
  1247. display: inline-block;
  1248. padding-right: 14rpx;
  1249. }
  1250. .sharemap {
  1251. margin: 0 auto;
  1252. text-align: center;
  1253. // margin-top: 15%;
  1254. // margin-bottom: 15%;
  1255. }
  1256. .sharemap image {
  1257. width: 400rpx;
  1258. height: 400rpx;
  1259. }
  1260. .sharetxt {
  1261. height: 100rpx;
  1262. display: flex;
  1263. flex-direction: column;
  1264. align-items: center;
  1265. justify-content: center;
  1266. }
  1267. .sharetxt text {
  1268. font-size: 24rpx;
  1269. text-align: left;
  1270. line-height: 20rpx
  1271. }
  1272. .butmin {
  1273. // height: 48rpx;
  1274. width: 250rpx;
  1275. background-color: #FCCF41;
  1276. line-height: 48rpx;
  1277. }
  1278. .butmin1 {
  1279. // height: 48rpx;
  1280. width: 250rpx;
  1281. background-color: #fff;
  1282. border: #000000 1rpx solid;
  1283. line-height: 48rpx;
  1284. }
  1285. .share {
  1286. text-align: center;
  1287. line-height: 10rpx;
  1288. margin-top: 10rpx;
  1289. }
  1290. .share image {
  1291. vertical-align: middle;
  1292. width: 25rpx;
  1293. height: 25rpx;
  1294. display: inline-block
  1295. }
  1296. .share p {
  1297. // display: inline-block;
  1298. font-size: 24rpx;
  1299. // color: #333333;
  1300. }
  1301. .img1 {
  1302. width: 84rpx;
  1303. height: 124rpx;
  1304. position: absolute;
  1305. }
  1306. .demo-uni-row {
  1307. margin-bottom: 10px;
  1308. // 组件在小程序端display为inline
  1309. // QQ、抖音小程序文档写有 :host,但实测不生效
  1310. // 百度小程序没有 :host
  1311. /* #ifdef MP-TOUTIAO || MP-QQ || MP-BAIDU */
  1312. /* #endif */
  1313. }
  1314. // 支付宝小程序没有 demo-uni-row 层级
  1315. // 微信小程序使用了虚拟化节点,没有 demo-uni-row 层级
  1316. /* #ifdef MP-ALIPAY || MP-WEIXIN */
  1317. ::v-deep .uni-row {
  1318. margin-bottom: 10px;
  1319. }
  1320. /* #endif */
  1321. .demo-uni-col {
  1322. height: 36px;
  1323. border-radius: 5px;
  1324. }
  1325. .dark_deep {
  1326. background-color: #99a9bf;
  1327. }
  1328. .dark {
  1329. background-color: #d3dce6;
  1330. }
  1331. .light {
  1332. background-color: #e5e9f2;
  1333. }
  1334. .example-body {
  1335. /* #ifndef APP-NVUE */
  1336. display: block;
  1337. /* #endif */
  1338. padding: 5rpx 10rpx 0;
  1339. overflow: hidden;
  1340. }
  1341. </style>