information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="basicInfo">
  7. <image :src="mainImg" style="width: 150rpx;height: 150rpx;" mode="">
  8. </image>
  9. <view class="basicInfo_txt">
  10. <p style="margin-bottom: 10rpx;font-size: 31rpx; font-weight: bold;">
  11. {{selection.selection_name}}
  12. </p>
  13. <p style="font-size: 27rpx;">售价:¥{{selection.YounggeeProduct[0].product_price}} &nbsp;&nbsp;&nbsp;&nbsp;
  14. 样叽高佣:{{selection.YounggeeProduct[0].exclusive_commission}}%</p>
  15. <p style="font-size: 27rpx;" v-if="selection.task_mode === 1">
  16. 额外悬赏:¥{{selection.RewardStrategy[0].per_reward}}</p>
  17. </view>
  18. </view>
  19. <view class="address">
  20. <view>
  21. <image class="address_icon" :src="picture.icon_loc" mode="">
  22. </image>
  23. </view>
  24. <view style="width: 70%;">
  25. <view style="display: flex;">
  26. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  27. <p class='ipon'>{{address.phone_number}}</p>
  28. </view>
  29. <p class='ipon'>{{address.full_detail_addr}}</p>
  30. </view>
  31. <view class="address_edit" @click="editAddress()">
  32. <image :src="picture.icon_edit" mode="">
  33. </image>
  34. </view>
  35. </view>
  36. <view class="keyInfo">
  37. <p style="margin-bottom: 30rpx;font-size: 36rpx; font-weight: bold;">任务要求</p>
  38. <!-- <p>内容形式:{{selection.show_content_type}}</p> -->
  39. <p>带货链接:{{selection.product_url}}
  40. <image :src="picture.icon_copy" mode="" class="copy-img" @click="handleCopy('123')" />
  41. </p>
  42. <p>领样要求:</p>
  43. <!-- 具体领样品要求(粉丝数量) -->
  44. <view class="markcontent">
  45. <view class="" v-for="item in selection.FreeStrategy">
  46. <p style=" margin-top: 20rpx; margin-bottom: 20rpx; font-size: 26rpx;">
  47. 粉丝量{{getFansLabel(item.fans_num)}},近30天橱窗销量≥{{item.sale_num}}单</p>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="account" @click="editAccount()">
  52. <view class="account_txt">
  53. <image
  54. src="https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/lQLPDhrXwll1_NcjI7AD0T3viYtxQwGOvh1SwG0A_35_35.png"
  55. mode=""></image>
  56. <span>{{account.nick_name}}</span>
  57. </view>
  58. <view class="account_fans">
  59. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  60. <p>{{account.fan}}</p>
  61. </view>
  62. <view class="account_btn">
  63. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  64. </view>
  65. </view>
  66. <view class="block"></view>
  67. <view class="submit">
  68. <button type="default" class="submit_btn" @click="submit()"> 确认报名并添加橱窗</button>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import region from '@/components/pca-code.json';
  74. import mvBar from "@/components/mys_navBar/mysNavBar";
  75. import {
  76. fansview
  77. } from '@/components/utils.js';
  78. export default {
  79. components: {
  80. mvBar
  81. },
  82. data() {
  83. return {
  84. navH: getApp().globalData.navHeight,
  85. picture: getApp().globalData.picture,
  86. mysNavConfig: {
  87. isHome: false,
  88. /* 固定导航 */
  89. navFixed: true,
  90. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  91. navTitle: {
  92. text: "信息确认",
  93. color: "",
  94. fontSize: "32rpx", // px upx rpx
  95. fontWeight: "", // 100 - 700
  96. },
  97. btnType: "type2",
  98. onLeftClick: '',
  99. /* type2 按钮 */
  100. type2Config: {
  101. // 左图标
  102. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  103. // 右图标
  104. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  105. // 圆角
  106. radius: "40rpx",
  107. },
  108. },
  109. options: [{
  110. value: '1',
  111. label: '所有人均可领取'
  112. },
  113. {
  114. value: '2',
  115. label: '1w下'
  116. },
  117. {
  118. value: '3',
  119. label: '1w-10w'
  120. },
  121. {
  122. value: '4',
  123. label: '10w-100w'
  124. },
  125. {
  126. value: '5',
  127. label: '100w-500w'
  128. },
  129. {
  130. value: '6',
  131. label: '500w-1000w'
  132. },
  133. {
  134. value: '7',
  135. label: '1000w以上'
  136. },
  137. ],
  138. selection: {},
  139. product: {},
  140. youngTeamId: "",
  141. youngLeadTeamId: "",
  142. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  143. account_id: -1,
  144. address_id: -1,
  145. address: null,
  146. project: null,
  147. account: null,
  148. strategy: null,
  149. thirdPlatform: [],
  150. saleNum_30: 0,
  151. }
  152. },
  153. onShow() {
  154. // 根据address_id查询address
  155. this.getDefaultAddress();
  156. // 查询account
  157. this.getTalentAccountInfo();
  158. },
  159. onLoad(options) {
  160. this.textObj = options.textObj.replace(/""/g, "");
  161. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  162. console.log("详情页传来的数据", this.textObj)
  163. this.saleNum_30 = this.textObj.saleNum_30
  164. this.selection = this.textObj.selection
  165. console.log("this.selection------>", this.selection)
  166. this.product = this.selection.YounggeeProduct[0]
  167. this.youngTeamId = this.textObj.youngTeamId
  168. this.youngLeadTeamId = this.textObj.youngLeadTeamId
  169. for (let i = 0; i < this.selection.YounggeeProductPhoto.length; ++i) {
  170. if (this.selection.YounggeeProductPhoto[i].symbol === 1) {
  171. this.mainImg = this.selection.YounggeeProductPhoto[i].photo_url
  172. }
  173. }
  174. console.log("this.mainIma---->", this.mainImg)
  175. if (this.youngLeadTeamId === "") {
  176. this.getLeadYoungTeamId()
  177. }
  178. },
  179. methods: {
  180. getFansLabel(fansNum) {
  181. const option = this.options.find(o => o.value === fansNum.toString());
  182. return option ? option.label : fansNum;
  183. },
  184. handleCopy(content) {
  185. wx.setClipboardData({
  186. data: content,
  187. success: function(res) {
  188. console.log("复制成功");
  189. }
  190. });
  191. },
  192. getLeadYoungTeamId() {
  193. // 调用后端接口,创建young之团,若young之团存在则返回teamid,否则创建young之团并返回id
  194. return this.$https.post('/youngee/c/t/p/add-young-team', {
  195. selection_id: this.selection.selection_id,
  196. project_type: 2,
  197. })
  198. .then(res => {
  199. console.log(res)
  200. this.youngLeadTeamId = res.data.data;
  201. })
  202. },
  203. //账号信息
  204. getTalentAccountInfo() {
  205. return this.$https.get('/youngee/c/t/g/get-talent-account-kuaishou')
  206. .then(res => {
  207. this.account = res.data.data[0]
  208. })
  209. // console.log("account数组——————: ",res)
  210. },
  211. //进入报名详情页肯定有收获地址
  212. getDefaultAddress() {
  213. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  214. console.log("get-talent-default-address---》", res.data.data)
  215. this.address = res.data.data;
  216. let a = this.address.region_code.toString().slice(0, 2) //前两位,提取省级或大区级别的代码
  217. let b = this.address.region_code.toString().slice(0, 4) //前四位,地区编码中提取更高层级的区域代码,例如市级代码
  218. let c = 0
  219. for (var i = 0; i < region.length; i++) {
  220. if (region[i].code == a) {
  221. a = region[i].name
  222. for (var j = 0; j < region[i].children.length; j++) {
  223. if (region[i].children[j].code == b) {
  224. b = region[i].children[j].name
  225. for (var o = 0; o < region[i].children[j].children.length; o++) {
  226. if (region[i].children[j].children[o].code == this.address
  227. .region_code) {
  228. c = region[i].children[j].children[o].name
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  236. console.log("get-talent-default-address---》", this.address.full_detail_addr)
  237. })
  238. },
  239. editAddress() {
  240. uni.navigateTo({
  241. url: '/page_mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  242. '&ismodify=1'
  243. });
  244. },
  245. editAccount() {
  246. uni.navigateTo({
  247. url: '/page_mycenter/bindaccounts/kuaishoubind'
  248. });
  249. },
  250. debugSubmit() {
  251. uni.navigateTo({
  252. url: '/page_tasksquare/wholetask/success'
  253. });
  254. },
  255. async submit() {
  256. //肯定有地址,样品肯定够,肯定有效期内,否则立即领样按钮无法点击
  257. console.log("api----", this.product.kuaishou_product_id)
  258. //调用加入橱窗api
  259. this.$https.get('/youngee/c/t/g/add-window' +
  260. "?" +
  261. "product_id" +
  262. "=" +
  263. this.product.kuaishou_product_id
  264. ).then(res => {
  265. console.log("add window res****", res)
  266. //未开通
  267. let api_result = res.data.data.data[0]
  268. if (api_result.result == 1800533) {
  269. uni.showModal({
  270. content: '添加橱窗失败,免费领样申请失败', // 这里设置弹窗的内容
  271. showCancel: false, // 不显示取消按钮
  272. confirmText: '知道了', // 设置确认按钮的文本
  273. success: function(res) {
  274. if (res.confirm) {
  275. console.log('用户点击知道了');
  276. }
  277. }
  278. });
  279. } else if (api_result.result == 1800550) {
  280. uni.showModal({
  281. content: '添加橱窗失败,免费领样申请失败', // 这里设置弹窗的内容
  282. showCancel: false, // 不显示取消按钮
  283. confirmText: '知道了', // 设置确认按钮的文本
  284. success: function(res) {
  285. if (res.confirm) {
  286. console.log('用户点击知道了');
  287. }
  288. }
  289. });
  290. } else {
  291. //添加橱窗成功。
  292. //添加到seltask带货任务中
  293. console.log("提交报名")
  294. // 直接报名
  295. console.log("********", this.selection.product_id)
  296. console.log("this.account.fan********111", this.account.fan)
  297. console.log("this.saleNum_30********111", this.saleNum_30)
  298. this.$https.post('/youngee/c/t/p/sign-up-sec-task', {
  299. address_id: this.address.address_id,
  300. selection_id: this.selection.selection_id,
  301. lead_team_id: this.youngLeadTeamId,
  302. team_id: this.youngTeamId,
  303. product_id: this.selection.product_id,
  304. //新增
  305. saleNum: this.saleNum_30,
  306. fans: this.account.fan,
  307. }).then(res => {
  308. console.log("sign-up-sec-task 的res", res)
  309. if (res.data.code == 0) {
  310. var data = {
  311. task_id: res.data.data.task_id
  312. };
  313. data = JSON.stringify(data)
  314. uni.navigateTo({
  315. url: '/page_selectionsquare/selectiondetail/success?textObj=' +
  316. encodeURIComponent(
  317. data)
  318. });
  319. } else {
  320. uni.showModal({
  321. content: '网络繁忙,请小主稍后再试~',
  322. });
  323. }
  324. })
  325. }
  326. })
  327. },
  328. },
  329. }
  330. </script>
  331. <style lang="scss" scoped>
  332. text {
  333. font-size: 32rpx;
  334. }
  335. p {
  336. font-size: 32rpx;
  337. }
  338. .basicInfo {
  339. display: flex;
  340. margin: 0 40rpx;
  341. padding: 30rpx 0;
  342. .basicInfo_txt {
  343. margin-left: 40rpx;
  344. padding-top: 20rpx;
  345. }
  346. }
  347. .address {
  348. display: flex;
  349. margin: 30rpx 40rpx 0;
  350. padding: 30rpx 0;
  351. justify-content: space-around;
  352. .address_icon {
  353. vertical-align: middle;
  354. width: 50rpx;
  355. height: 50rpx;
  356. display: inline-block;
  357. padding-right: 30rpx;
  358. }
  359. .address_edit {}
  360. .address_edit image {
  361. vertical-align: middle;
  362. width: 50rpx;
  363. height: 50rpx;
  364. display: inline-block;
  365. padding-right: 14rpx;
  366. }
  367. .ipon {
  368. color: #333333;
  369. font-size: 30rpx;
  370. margin-bottom: 10rpx;
  371. }
  372. }
  373. .keyInfo {
  374. margin: 30rpx 40rpx;
  375. }
  376. .keyInfo span {
  377. display: flex;
  378. align-items: center;
  379. margin: 10rpx 0;
  380. }
  381. .keyInfo p {
  382. margin: 25rpx 0;
  383. }
  384. .account {
  385. display: flex;
  386. align-items: center;
  387. width: 690rpx;
  388. padding: 24rpx 0;
  389. margin: 0 auto;
  390. .account_txt {
  391. display: inline-block;
  392. padding: 0 0 0 1%;
  393. width: 400rpx;
  394. }
  395. .account_txt span {
  396. color: #333333;
  397. font-weight: 550;
  398. text-indent: 2em;
  399. font-size: 32rpx;
  400. }
  401. .account_txt image {
  402. vertical-align: middle;
  403. width: 50rpx;
  404. height: 50rpx;
  405. display: inline-block;
  406. padding-right: 14rpx;
  407. }
  408. .account_fans {
  409. display: flex;
  410. width: 250rpx;
  411. }
  412. .account_fans p {
  413. display: inline-block;
  414. color: #333333;
  415. font-weight: 550;
  416. }
  417. .account_btn {}
  418. }
  419. .block {
  420. width: 100%;
  421. height: 100rpx;
  422. margin-top: 5%;
  423. }
  424. .submit {
  425. box-shadow: 0rpx 5rpx 40rpx #ccc;
  426. width: 100%;
  427. position: fixed;
  428. bottom: 0rpx;
  429. display: flex;
  430. height: 90rpx;
  431. padding-top: 2%;
  432. background-color: #FFFFFF;
  433. .submit_btn {
  434. background-color: #FCCF41;
  435. border-radius: 20rpx;
  436. font-size: 30rpx;
  437. line-height: 220%;
  438. letter-spacing: 5rpx;
  439. height: 80%;
  440. }
  441. }
  442. </style>