selectionsquare.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  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.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. console.log("过滤条件", this.filtCondition)
  591. uni.showLoading({
  592. title: '加载中'
  593. });
  594. this.selectionList = []
  595. await this.getSelectionListApi()
  596. uni.hideLoading();
  597. },
  598. async reset() {
  599. this.per = 0;
  600. this.$refs.popup.close()
  601. this.formData.hobby1 = [];
  602. this.formData.hobby2 = [];
  603. this.formData.hobby3 = [];
  604. this.filtCondition = '';
  605. uni.showLoading({
  606. title: '加载中'
  607. });
  608. this.selectionList = []
  609. await this.getSelectionListApi()
  610. uni.hideLoading();
  611. },
  612. /* 点击左侧 */
  613. onLeftClick() {
  614. uni.navigateTo({
  615. url: '/page_selectionsquare/search'
  616. });
  617. },
  618. isLoginApi() {
  619. return this.$https.get('/youngee/c/t/g/is-login')
  620. .then(res => {
  621. if (res.data.code === 403) {
  622. // 登陆已失效
  623. this.token = ""
  624. uni.clearStorage();
  625. } else {
  626. this.token = uni.getStorageSync('token')
  627. }
  628. })
  629. },
  630. //获取一些info表中的信息----包含thirdplatform
  631. //res是一个包含服务器响应的对象
  632. getInfoListApi() {
  633. return this.$http.get('/youngee/c/g/get-info-tables')
  634. .then(res => {
  635. this.hobby = []
  636. this.platformList = res.data.data.ThirdPlatform
  637. let l = this.platformList != null ? this.platformList.length : 0;
  638. for (var i = 0; i < l; i++) {
  639. var obj = {}
  640. obj.text = this.platformList[i].platform_name
  641. obj.value = this.platformList[i].id
  642. this.hobby.push(obj)
  643. }
  644. })
  645. },
  646. getSelectionListApi() {
  647. this.filtCondition =
  648. "&secform[]=1&taskform[]=1&categoryform[]=1&categoryform[]=6&createTime[]=3"
  649. //idx:当前页 cnt:每页展示个数
  650. return this.$http.get('/youngee/c/g/get-selection-list' +
  651. "?" +
  652. "idx" +
  653. "=" +
  654. this.per +
  655. "&cnt=20" +
  656. "&" +
  657. "sortField=" +
  658. "sales_count" +
  659. "sortOrder=1" +
  660. "&searchvalue=" +
  661. "桌面" +
  662. this.filtCondition
  663. // 20 + this.filtCondition
  664. //请求发送后,使用 .then() 方法处理响应结果 res。
  665. ).then(res => {
  666. if (res.data.code === 0) {
  667. console.log("res is here------->: ", res)
  668. // 获取res返回数据
  669. this.max_page = res.data.data.max_page
  670. let selectionList = res.data.data.SelectionDetail
  671. const count = res.data.data.count
  672. // 数据处理
  673. if (selectionList === null) {
  674. return
  675. }
  676. for (var i = 0; i < selectionList.length; i++) {
  677. console.log("**** selectionList[i]****", selectionList[i])
  678. this.product = selectionList[i].YounggeeProduct
  679. this.younggeeProductPhoto = selectionList[i].YounggeeProductPhoto
  680. // for (let j = 0; j < this.younggeeProductPhoto.length; ++j) {
  681. // //1为主图,2为详情图,3为视频 selectionList[i]就是item
  682. // if (this.younggeeProductPhoto[j].symbol == 1) {
  683. // selectionList[i].coverphoto = this.younggeeProductPhoto[j].photo_url
  684. // }
  685. // }
  686. for (var k = 0; k < this.platformList.length; k++) {
  687. if (selectionList[i].platform === this.platformList[k].id) {
  688. selectionList[i].platform_icon = this.platformList[k].platform_icon
  689. }
  690. }
  691. //打印商品详情表
  692. console.log(selectionList[i])
  693. // 商品价格
  694. selectionList[i].price = this.product.product_price
  695. //高佣
  696. selectionList[i].exclusive_commission = this.product.exclusive_commission
  697. //预估赚
  698. selectionList[i].show_earn = this.product.commission_price
  699. //额外悬赏
  700. if (selectionList[i].task_mode == 1) {
  701. selectionList[i].show_task_reward = selectionList[i].RewardStrategy.per_reward
  702. }
  703. // 判断是否到期
  704. selectionList[i].isFinished = this.isFinish(selectionList[i])
  705. // 判断是否有库存
  706. selectionList[i].isLacked = selectionList[i].remain_num == 0 ? true : false
  707. }
  708. //...selectionList 是扩展运算符的语法,它会将 selectionList 数组中的所有元素展开,并作为单独的参数传递给 push() 方法
  709. //用于在原有数据的基础上添加新的数据
  710. this.selectionList.push(...selectionList);
  711. }
  712. });
  713. },
  714. isFinish(selection) {
  715. var timeNow = new Date();
  716. var ddl = new Date(selection.task_ddl.replace(/-/g, "/"));
  717. var diff = getDaysAndHoursBetweenDates(timeNow, ddl);
  718. let remain_days = diff.days;
  719. let remain_hours = diff.hours;
  720. if (remain_days <= 0 & remain_hours <= 0) return true;
  721. // let remain_days = getDaysBetweenDates(timeNow, ddl);
  722. // if (remain_days < 0) return true;
  723. else return false;
  724. },
  725. toggle4(type) {
  726. this.type4 = type
  727. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  728. this.$refs.popup4.open(type)
  729. // this.$refs.popup1.close()
  730. },
  731. // 保存图片
  732. async saveImage() {
  733. // showToast('保存成功')
  734. wx.downloadFile({
  735. url: this.kefuUrl,
  736. success: function(res) {
  737. wx.saveImageToPhotosAlbum({
  738. filePath: res.tempFilePath,
  739. success: function(data) {
  740. wx.showToast({
  741. title: "保存成功",
  742. icon: "success",
  743. duration: 2000
  744. })
  745. },
  746. fail: function(err) {
  747. console.log(err);
  748. },
  749. complete(res) {
  750. console.log(res);
  751. }
  752. })
  753. }
  754. })
  755. },
  756. closepop() {
  757. this.$refs.popup4.close()
  758. },
  759. xieyi() {
  760. console.log('进入联系我们')
  761. },
  762. pick(item) {
  763. console.log(item)
  764. uni.navigateTo({
  765. url: item.name
  766. });
  767. },
  768. }
  769. }
  770. </script>
  771. <style>
  772. /deep/ .share .uni-popup .uni-popup__wrapper {
  773. width: 80% !important;
  774. border-radius: 15rpx !important;
  775. }
  776. </style>
  777. <style lang="scss" scoped>
  778. //nav
  779. .nav {
  780. position: relative;
  781. }
  782. .nv_padding {
  783. height: 88upx;
  784. background-color: transparent;
  785. }
  786. /* 图标默认大小 */
  787. .nv_icon {
  788. width: 16px;
  789. height: 16px;
  790. }
  791. .bg_box {
  792. position: absolute;
  793. width: 750upx;
  794. height: 88upx;
  795. z-index: 10;
  796. top: 0;
  797. background-color: transparent;
  798. /* #ifdef MP */
  799. box-sizing: border-box;
  800. /* #endif */
  801. /* #ifndef APP-PLUS-NVUE */
  802. background-size: cover;
  803. background-repeat: no-repeat;
  804. background-position: center center;
  805. /* #endif */
  806. }
  807. .mys_navBar {
  808. /* #ifndef APP-PLUS-NVUE */
  809. display: flex;
  810. height: 88upx;
  811. /* #endif */
  812. // #ifdef MP
  813. box-sizing: border-box;
  814. // #endif
  815. width: 750upx;
  816. flex-direction: row;
  817. background-color: transparent;
  818. position: absolute;
  819. z-index: 10;
  820. top: 0;
  821. }
  822. .fixed {
  823. position: fixed;
  824. }
  825. /*
  826. left 按钮
  827. */
  828. .btn_type {
  829. /* #ifndef APP-PLUS-NVUE */
  830. display: flex;
  831. /* #endif */
  832. /* #ifdef APP-PLUS-NVUE */
  833. margin-left: 16upx;
  834. /* #endif */
  835. // #ifndef MP
  836. align-items: center;
  837. // #endif
  838. flex: 1;
  839. flex-direction: row;
  840. // background-color: #fff;
  841. }
  842. .btn_box {
  843. /* #ifndef APP-PLUS-NVUE */
  844. display: flex;
  845. margin-left: 16upx;
  846. /* #endif */
  847. flex-direction: row;
  848. // #ifndef MP
  849. align-items: center;
  850. // #endif
  851. }
  852. .btn_back,
  853. .btn_home {
  854. /* #ifndef APP-PLUS-NVUE */
  855. display: flex;
  856. /* #endif */
  857. /* #ifndef APP-PLUS-NVUE */
  858. height: 100%;
  859. /* #endif */
  860. /* #ifdef APP-PLUS-NVUE */
  861. width: 76upx;
  862. height: 62upx;
  863. /* #endif */
  864. flex-direction: row;
  865. align-items: center;
  866. justify-content: center;
  867. flex: 1;
  868. }
  869. /* 按钮类型1 */
  870. .nav_btn_t1 {
  871. /* #ifndef APP-PLUS-NVUE */
  872. display: flex;
  873. /* #endif */
  874. // #ifdef MP
  875. box-sizing: border-box;
  876. // #endif
  877. flex-direction: row;
  878. align-items: center;
  879. border-style: solid;
  880. border-width: 1px;
  881. border-color: #C0C0C0;
  882. // background-color: rgba(0, 0, 0, 0.2);
  883. background-color: #FFFFFF;
  884. width: 130upx;
  885. height: 45upx;
  886. }
  887. .line {
  888. width: 1upx;
  889. height: 60%;
  890. /* #ifdef APP-PLUS-NVUE */
  891. height: 30upx;
  892. /* #endif */
  893. background-color: #C0C0C0;
  894. }
  895. /*
  896. 标题
  897. */
  898. .title_container {
  899. /* #ifndef APP-PLUS-NVUE */
  900. display: flex;
  901. /* #endif */
  902. position: absolute;
  903. left: 375upx;
  904. bottom: 0;
  905. transform: translateX(-50%);
  906. flex-direction: row;
  907. justify-content: center;
  908. align-items: center;
  909. }
  910. .title_text {
  911. // flex: 1;
  912. text-overflow: ellipsis;
  913. /* #ifndef APP-PLUS-NVUE */
  914. white-space: nowrap;
  915. overflow: hidden;
  916. font-weight: 550;
  917. /* #endif */
  918. /* #ifdef APP-PLUS-NVUE */
  919. lines: 1;
  920. /* #endif */
  921. }
  922. /*
  923. 左边自定义
  924. */
  925. .my_left_box {
  926. /* #ifndef APP-PLUS-NVUE */
  927. display: flex;
  928. /* #endif */
  929. flex-direction: row;
  930. align-items: center;
  931. }
  932. .my_left_icon {
  933. /* #ifndef APP-PLUS-NVUE */
  934. display: flex;
  935. /* #endif */
  936. flex-direction: row;
  937. align-items: center;
  938. justify-content: center;
  939. /* #ifndef MP */
  940. margin-left: 18upx;
  941. /* #endif */
  942. }
  943. .my_left_custom {
  944. /* #ifndef APP-PLUS-NVUE */
  945. display: flex;
  946. /* #endif */
  947. flex-direction: row;
  948. align-items: center;
  949. // justify-content: center;
  950. }
  951. /* 文字 */
  952. .leftText {
  953. /* #ifndef APP-PLUS-NVUE */
  954. display: flex;
  955. /* #endif */
  956. flex-direction: row;
  957. align-items: center;
  958. justify-content: center;
  959. padding-left: 4upx;
  960. font-size: 15px;
  961. }
  962. /*
  963. 中间
  964. */
  965. .my_custom_box {
  966. /* #ifndef APP-PLUS-NVUE */
  967. display: flex;
  968. /* #endif */
  969. flex-direction: row;
  970. align-items: center;
  971. justify-content: center;
  972. flex: 1;
  973. }
  974. /*
  975. 搜索框
  976. */
  977. .nv_search_box {
  978. /* #ifndef APP-PLUS-NVUE */
  979. display: flex;
  980. /* #endif */
  981. flex-direction: row;
  982. align-items: center;
  983. flex: 1;
  984. /* #ifndef MP */
  985. height: 60upx;
  986. /* #endif */
  987. background-color: #f8f8f8;
  988. padding-right: 20upx;
  989. padding-left: 20upx;
  990. border-radius: 60upx;
  991. margin-right: 15upx;
  992. margin-left: 15upx;
  993. }
  994. .nv_input {
  995. flex: 1;
  996. padding-left: 16upx;
  997. font-size: 13px;
  998. }
  999. .close {
  1000. width: 50upx;
  1001. /* #ifndef APP-PLUS-NVUE */
  1002. display: flex;
  1003. /* #endif */
  1004. flex-direction: row;
  1005. align-items: center;
  1006. justify-content: center;
  1007. /* #ifndef MP */
  1008. height: 62upx;
  1009. /* #endif */
  1010. }
  1011. /*
  1012. 右边 自定义
  1013. */
  1014. .my_right_icon {
  1015. /* #ifndef APP-PLUS-NVUE */
  1016. display: flex;
  1017. /* #endif */
  1018. flex-direction: row;
  1019. align-items: center;
  1020. justify-content: center;
  1021. /* #ifndef MP */
  1022. // min-width: 70upx;
  1023. /* #endif */
  1024. padding-left: 6px;
  1025. padding-right: 10px;
  1026. }
  1027. .imge image {
  1028. width: 100%;
  1029. height: 260rpx;
  1030. }
  1031. </style>
  1032. <style lang="scss" scoped>
  1033. .option1 {
  1034. padding: 5rpx 18rpx;
  1035. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  1036. text-align: center;
  1037. }
  1038. }
  1039. .option2 {
  1040. padding: 5rpx 18rpx;
  1041. }
  1042. .option3 {
  1043. padding: 5rpx 18rpx;
  1044. /deep/.uni-data-checklist .checklist-group .checklist-box .checklist-content {
  1045. // width: 120rpx;
  1046. text-align: center;
  1047. }
  1048. }
  1049. .butmin {
  1050. // height: 48rpx;
  1051. width: 250rpx;
  1052. background-color: #FCCF41;
  1053. line-height: 48rpx;
  1054. }
  1055. .butmin1 {
  1056. // height: 48rpx;
  1057. width: 250rpx;
  1058. background-color: #fff;
  1059. border: #000000 1rpx solid;
  1060. line-height: 48rpx;
  1061. }
  1062. //弹出层
  1063. /deep/ .uni-data-checklist .checklist-group .checklist-box {
  1064. background-color: #FFFFFF !important;
  1065. border-radius: 20rpx !important;
  1066. padding: 8rpx 30rpx !important;
  1067. border: 0 !important;
  1068. }
  1069. /deep/ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
  1070. font-size: 24rpx;
  1071. color: #333333;
  1072. }
  1073. /deep/ .mini-btn {
  1074. height: 70rpx;
  1075. width: 250rpx;
  1076. line-height: 70rpx;
  1077. margin: 20rpx;
  1078. letter-spacing: 4rpx;
  1079. background-color: #FCCF41;
  1080. }
  1081. /deep/ .mini-btn1 {
  1082. height: 70rpx;
  1083. width: 400rpx;
  1084. line-height: 70rpx;
  1085. margin: 20rpx;
  1086. letter-spacing: 4rpx;
  1087. color: white;
  1088. ;
  1089. }
  1090. /deep/ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
  1091. background-color: #FCCF41 !important;
  1092. }
  1093. .butto {
  1094. text-align: center;
  1095. }
  1096. .swiper {
  1097. height: 300rpx;
  1098. }
  1099. .swiper-item {
  1100. display: block;
  1101. height: 300rpx;
  1102. line-height: 300rpx;
  1103. text-align: center;
  1104. }
  1105. .swiper-list {
  1106. margin-top: 40rpx;
  1107. margin-bottom: 0;
  1108. }
  1109. </style>
  1110. <style lang="scss" scoped>
  1111. .commodity {
  1112. margin-top: 10rpx;
  1113. display: flex;
  1114. flex-wrap: wrap;
  1115. justify-content: space-between;
  1116. }
  1117. .project {
  1118. width: 49%;
  1119. height: 550rpx;
  1120. border-radius: 20rpx;
  1121. margin-bottom: 4%;
  1122. }
  1123. .projectdiagram {
  1124. width: 100%;
  1125. height: 61%;
  1126. background-size: 100% 100%;
  1127. position: relative;
  1128. border-radius: 10rpx;
  1129. }
  1130. .projecttext {
  1131. // padding-top: 5%;
  1132. padding: 0 0 0 1%;
  1133. // height: 80rpx;
  1134. }
  1135. .projecttext span {
  1136. color: #333333;
  1137. font-size: 25rpx;
  1138. font-weight: 550;
  1139. text-indent: 2em;
  1140. }
  1141. .projecttext image {
  1142. vertical-align: middle;
  1143. width: 30rpx;
  1144. height: 30rpx;
  1145. display: inline-block;
  1146. margin-right: 14rpx;
  1147. }
  1148. .projectinfo {
  1149. display: flex;
  1150. justify-content: space-between;
  1151. margin-top: 5%;
  1152. }
  1153. .projectinfotxt {
  1154. display: flex;
  1155. flex-direction: column;
  1156. align-items: center;
  1157. justify-content: center;
  1158. }
  1159. .projectinfotxt p {
  1160. color: #767272;
  1161. font-size: 20rpx;
  1162. margin: 5rpx 0;
  1163. }
  1164. .projectinfotag {
  1165. display: flex;
  1166. justify-content: space-around;
  1167. align-items: center;
  1168. }
  1169. // 美化背景色
  1170. .section {
  1171. display: flex;
  1172. align-items: center;
  1173. justify-content: space-between;
  1174. font-size: 20rpx;
  1175. margin: 6rpx 0;
  1176. color: #ffffff;
  1177. }
  1178. .section1 {
  1179. background-image: linear-gradient(to top, #c54529, #e38e3e);
  1180. border-radius: 8px;
  1181. width: 140rpx;
  1182. height: 45rpx;
  1183. text-align: center;
  1184. line-height: 40rpx;
  1185. }
  1186. .section2 {
  1187. background-image: linear-gradient(to top, #6991e1, #db9c53);
  1188. border-radius: 8px;
  1189. width: 200rpx;
  1190. height: 45rpx;
  1191. text-align: center;
  1192. line-height: 40rpx;
  1193. }
  1194. .TitleText {
  1195. // height: 30rpx;
  1196. width: 120rpx;
  1197. height: 45rpx;
  1198. background-color: #f70606;
  1199. border-radius: 20rpx;
  1200. display: inline-block;
  1201. text-align: center;
  1202. // padding: 0rpx 10rpx 0rpx 10rpx;
  1203. margin-right: 6%;
  1204. line-height: 42rpx;
  1205. }
  1206. .TitleText p {
  1207. color: #fff;
  1208. font-size: 20rpx;
  1209. }
  1210. .Mask {
  1211. position: absolute;
  1212. background-color: #000000;
  1213. opacity: 0.6;
  1214. width: 100%;
  1215. height: 100%;
  1216. // z-index: 999;
  1217. text-align: center;
  1218. border-radius: 20rpx;
  1219. }
  1220. .Mask image {
  1221. width: 50%;
  1222. height: 52%;
  1223. padding-top: 25%;
  1224. }
  1225. .contt {
  1226. position: relative;
  1227. }
  1228. .contact {
  1229. position: fixed;
  1230. top: 80%;
  1231. right: 13%;
  1232. }
  1233. //弹窗
  1234. .sharepage {
  1235. // width: 90%;
  1236. margin: 0 auto;
  1237. // position: relative;
  1238. }
  1239. /deep/ .share.uni-popup .uni-popup__wrapper {
  1240. width: 70%;
  1241. border-radius: 15rpx;
  1242. }
  1243. .projecttext1 {
  1244. // padding-top: 5%;
  1245. padding: 0 0 0 1%;
  1246. height: 80rpx;
  1247. margin: 5% 0;
  1248. text-align: center;
  1249. }
  1250. .projecttext1 image {
  1251. vertical-align: middle;
  1252. width: 80rpx;
  1253. height: 80rpx;
  1254. display: inline-block;
  1255. padding-right: 14rpx;
  1256. }
  1257. .sharemap {
  1258. margin: 0 auto;
  1259. text-align: center;
  1260. // margin-top: 15%;
  1261. // margin-bottom: 15%;
  1262. }
  1263. .sharemap image {
  1264. width: 400rpx;
  1265. height: 400rpx;
  1266. }
  1267. .sharetxt {
  1268. height: 100rpx;
  1269. display: flex;
  1270. flex-direction: column;
  1271. align-items: center;
  1272. justify-content: center;
  1273. }
  1274. .sharetxt text {
  1275. font-size: 24rpx;
  1276. text-align: left;
  1277. line-height: 20rpx
  1278. }
  1279. .butmin {
  1280. // height: 48rpx;
  1281. width: 250rpx;
  1282. background-color: #FCCF41;
  1283. line-height: 48rpx;
  1284. }
  1285. .butmin1 {
  1286. // height: 48rpx;
  1287. width: 250rpx;
  1288. background-color: #fff;
  1289. border: #000000 1rpx solid;
  1290. line-height: 48rpx;
  1291. }
  1292. .share {
  1293. text-align: center;
  1294. line-height: 10rpx;
  1295. margin-top: 10rpx;
  1296. }
  1297. .share image {
  1298. vertical-align: middle;
  1299. width: 25rpx;
  1300. height: 25rpx;
  1301. display: inline-block
  1302. }
  1303. .share p {
  1304. // display: inline-block;
  1305. font-size: 24rpx;
  1306. // color: #333333;
  1307. }
  1308. .img1 {
  1309. width: 84rpx;
  1310. height: 124rpx;
  1311. position: absolute;
  1312. }
  1313. .demo-uni-row {
  1314. margin-bottom: 10px;
  1315. // 组件在小程序端display为inline
  1316. // QQ、抖音小程序文档写有 :host,但实测不生效
  1317. // 百度小程序没有 :host
  1318. /* #ifdef MP-TOUTIAO || MP-QQ || MP-BAIDU */
  1319. /* #endif */
  1320. }
  1321. // 支付宝小程序没有 demo-uni-row 层级
  1322. // 微信小程序使用了虚拟化节点,没有 demo-uni-row 层级
  1323. /* #ifdef MP-ALIPAY || MP-WEIXIN */
  1324. ::v-deep .uni-row {
  1325. margin-bottom: 10px;
  1326. }
  1327. /* #endif */
  1328. .demo-uni-col {
  1329. height: 36px;
  1330. border-radius: 5px;
  1331. }
  1332. .dark_deep {
  1333. background-color: #99a9bf;
  1334. }
  1335. .dark {
  1336. background-color: #d3dce6;
  1337. }
  1338. .light {
  1339. background-color: #e5e9f2;
  1340. }
  1341. .example-body {
  1342. /* #ifndef APP-NVUE */
  1343. display: block;
  1344. /* #endif */
  1345. padding: 5rpx 10rpx 0;
  1346. overflow: hidden;
  1347. }
  1348. </style>