selectionsquare.vue 34 KB

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