information.vue 12 KB

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