information.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  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: 36rpx;">{{project.project_name}}</p>
  11. <p>商品价值:{{project.Product.ProductPrice}}元</p>
  12. </view>
  13. </view>
  14. <view class="address">
  15. <view>
  16. <image class="address_icon" :src="picture.icon_loc" mode="">
  17. </image>
  18. </view>
  19. <view style="width: 70%;">
  20. <view style="display: flex;">
  21. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  22. <p class='ipon'>{{address.phone_number}}</p>
  23. </view>
  24. <p class='ipon'>{{address.full_detail_addr}}</p>
  25. </view>
  26. <view class="address_edit" @click="editAddress()">
  27. <image :src="picture.icon_edit" mode="">
  28. </image>
  29. </view>
  30. </view>
  31. <view class="keyInfo">
  32. <!-- <p style="margin-bottom: 30rpx;font-size: 36rpx;">关键任务信息</p> -->
  33. <p style="margin-top: 10rpx;">合作佣金</p>
  34. <view style="padding-top: 10rpx;">
  35. <p>粉丝量:{{strategy.show_followers_low}}-{{strategy.show_followers_up}}
  36. </p>
  37. </view>
  38. <view style="display: flex;">
  39. <p>
  40. 稿费:{{strategy.fee_form_t}}
  41. </p>
  42. <view v-if="strategy.fee_form==3">
  43. <p>{{strategy.showOffer}}元</p>
  44. </view>
  45. </view>
  46. <!-- <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  47. <p style="margin-top: 10rpx;">社媒平台</p>
  48. <view style="display: flex;padding-top: 10rpx;">
  49. <p>{{project.PlatformInfo.platform_name}}</p>
  50. </view>
  51. <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  52. <p style="margin-top: 10rpx;">任务要求</p>
  53. <view class="keyInfo_task">
  54. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  55. <p>内容形式:</p>
  56. <p class="keyInfo_task_txt">{{project.content}}</p>
  57. </view>
  58. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  59. <p>任务形式:</p>
  60. <p class="keyInfo_task_txt">{{project.project_form}}</p>
  61. </view>
  62. <p style="margin: 5rpx 0;">商品描述:</p>
  63. <text class="keyInfo_task_txt">{{project.Product.ProductDetail}}</text>
  64. <p style="margin: 35rpx 0 0rpx;">任务详情:</p>
  65. <text class="keyInfo_task_txt">{{project.project_detail}}</text>
  66. </view> -->
  67. </view>
  68. <view class="account" @click="editAccount()">
  69. <view class="account_txt">
  70. <image :src="project.PlatformInfo.platform_icon" mode=""></image>
  71. <span>{{account.nick_name}}</span>
  72. </view>
  73. <view class="account_fans">
  74. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  75. <p>{{account.show_fans_count}}</p>
  76. </view>
  77. <view class="account_btn">
  78. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  79. </view>
  80. </view>
  81. <view class="block"></view>
  82. <view class="submit">
  83. <button type="default" class="submit_btn" @click="Desubmit()"> 确认报名</button>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import region from '@/components/pca-code.json';
  89. import mvBar from "@/components/mys_navBar/mysNavBar";
  90. import {
  91. fansview
  92. } from '@/components/utils.js';
  93. export default {
  94. components: {
  95. mvBar
  96. },
  97. data() {
  98. return {
  99. navH: getApp().globalData.navHeight,
  100. picture: getApp().globalData.picture,
  101. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  102. account_id: -1,
  103. address_id: -1,
  104. address: null,
  105. project: null,
  106. account: null,
  107. strategy: null,
  108. thirdPlatform: [],
  109. mysNavConfig: {
  110. isHome: false,
  111. /* 固定导航 */
  112. navFixed: true,
  113. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  114. navTitle: {
  115. text: "信息确认",
  116. color: "",
  117. fontSize: "32rpx", // px upx rpx
  118. fontWeight: "", // 100 - 700
  119. },
  120. btnType: "type2",
  121. onLeftClick: '',
  122. /* type2 按钮 */
  123. type2Config: {
  124. // 左图标
  125. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  126. // 右图标
  127. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  128. // 圆角
  129. radius: "40rpx",
  130. },
  131. },
  132. }
  133. },
  134. onShow() {
  135. // 根据address_id查询address
  136. this.getDefaultAddress();
  137. // 查询account
  138. this.getAccount();
  139. },
  140. onLoad(options) {
  141. this.textObj = options.textObj.replace(/""/g, "");
  142. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  143. console.log(this.textObj)
  144. this.project = this.textObj.information
  145. this.strategy = this.textObj.strategy
  146. // console.log(this.project)
  147. for (let i = 0; i < this.project.Product.ProductPhoto.length; ++i) {
  148. if (this.project.Product.ProductPhoto[i].Symbol === 1) {
  149. this.mainImg = this.project.Product.ProductPhoto[i].PhotoUrl
  150. }
  151. }
  152. this.strategy.show_followers_low = fansview(this.strategy.followers_low)
  153. this.strategy.show_followers_up = fansview(this.strategy.followers_up)
  154. },
  155. methods: {
  156. getAccount() {
  157. this.$https.get('/youngee/c/t/g/get-talent-account-kuaishou')
  158. .then(res => {
  159. console.log("快手账号信息---", res)
  160. if (res.data.code !== -3) {
  161. let account = res.data.data
  162. while (this.project == null) {}
  163. for (var i = 0; i < account.length; i++) {
  164. if (this.project.project_platform == account[i].platform_id) {
  165. this.account = account[i]
  166. }
  167. break
  168. }
  169. console.log("唯一账号信息---", this.account)
  170. this.account.show_fans_count = fansview(this.account.fan)
  171. }
  172. })
  173. },
  174. getDefaultAddress() {
  175. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  176. console.log(res.data.data)
  177. this.address = res.data.data;
  178. let a = this.address.region_code.toString().slice(0, 2)
  179. let b = this.address.region_code.toString().slice(0, 4)
  180. let c = 0
  181. for (var i = 0; i < region.length; i++) {
  182. if (region[i].code == a) {
  183. a = region[i].name
  184. for (var j = 0; j < region[i].children.length; j++) {
  185. if (region[i].children[j].code == b) {
  186. b = region[i].children[j].name
  187. for (var o = 0; o < region[i].children[j].children.length; o++) {
  188. if (region[i].children[j].children[o].code == this.address
  189. .region_code) {
  190. c = region[i].children[j].children[o].name
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  198. })
  199. },
  200. editAddress() {
  201. uni.navigateTo({
  202. url: '/page_mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  203. '&ismodify=1'
  204. });
  205. },
  206. editAccount() {
  207. uni.navigateTo({
  208. url: '/page_mycenter/myinformation/bindaccount?platform_id=' + this.account.platform_id +
  209. '&account_id=' +
  210. this.account.account_id
  211. });
  212. },
  213. debugSubmit() {
  214. uni.navigateTo({
  215. url: '/page_tasksquare/wholetask/success'
  216. });
  217. },
  218. //报名测试
  219. Desubmit() {
  220. // 3. 插入一条任务
  221. this.$https.post('/youngee/c/t/p/sign-up-task-with-ks-account', {
  222. address_id: 255,
  223. project_id: "2402864436",
  224. open_id: "f1b0d3a11c24fcde14bf5724d0d1cdfc",
  225. strategy_id: 3,
  226. offer: 300, //最终达人选中的稿费金额
  227. }).then(res => {
  228. console.log("报名结果---》", res)
  229. if (res.data.code == 0) {
  230. var data = {
  231. task_id: res.data.data
  232. };
  233. data = JSON.stringify(data)
  234. uni.navigateTo({
  235. url: '/page_tasksquare/wholetask/success?textObj=' + encodeURIComponent(
  236. data)
  237. });
  238. } else {
  239. uni.showModal({
  240. content: '网络繁忙,请小主稍后再试~',
  241. });
  242. }
  243. })
  244. },
  245. // 提交确认报名
  246. submit() {
  247. console.log(this.project)
  248. // 1. 判断任务是否截止
  249. this.$https.get('/youngee/c/t/g/get-project-detail' +
  250. "?" +
  251. "project_id" +
  252. "=" +
  253. this.project.project_id
  254. ).then(res => {
  255. console.log("获取种草详情接口----",
  256. res)
  257. // 当前时间
  258. var newdate = new Date()
  259. // 截止时间
  260. var endTime = new Date(res.data.data.recruit_ddl.replace(/-/g, "/"));
  261. console.log(endTime)
  262. if (endTime - newdate < 0) {
  263. // 招募截止
  264. uni.showToast({
  265. title: "任务已结束",
  266. duration: 1000,
  267. });
  268. uni.navigateTo({
  269. url: '/pages/tasksquare/tasksquare'
  270. });
  271. }
  272. })
  273. // 2. 判断粉丝量是否符合条件
  274. if (this.account.fan < this.strategy.followers_low) {
  275. // 招募截止
  276. uni.showToast({
  277. title: "粉丝量不达标",
  278. duration: 1000,
  279. });
  280. } else {
  281. // 3. 插入一条任务
  282. this.$https.post('/youngee/c/t/p/sign-up-task', {
  283. address_id: this.address.address_id,
  284. project_id: this.project.project_id,
  285. strategy_id: this.strategy.strategy_id,
  286. offer: this.strategy.offer, //最终达人选中的稿费金额
  287. }).then(res => {
  288. console.log("报名结果---》", res)
  289. if (res.data.code == 0) {
  290. var data = {
  291. task_id: res.data.data
  292. };
  293. data = JSON.stringify(data)
  294. uni.navigateTo({
  295. url: '/page_tasksquare/wholetask/success?textObj=' + encodeURIComponent(
  296. data)
  297. });
  298. } else {
  299. uni.showModal({
  300. content: '网络繁忙,请小主稍后再试~',
  301. });
  302. }
  303. })
  304. }
  305. },
  306. // 信息表
  307. getInfoList() {
  308. this.$http.get('/youngee/c/g/get-info-tables')
  309. .then(res => {
  310. this.hobby = []
  311. console.log(res)
  312. this.thirdPlatform = res.data.data.ThirdPlatform
  313. for (var i = 0; i < this.listsrc.length; i++) {
  314. var obj = {}
  315. obj.text = this.listsrc[i].platform_name
  316. obj.value = this.listsrc[i].id
  317. this.hobby.push(obj)
  318. }
  319. })
  320. },
  321. }
  322. }
  323. </script>
  324. <style lang="scss" scoped>
  325. text {
  326. font-size: 32rpx;
  327. }
  328. p {
  329. font-size: 32rpx;
  330. }
  331. .basicInfo {
  332. display: flex;
  333. margin: 0 40rpx;
  334. padding: 30rpx 0;
  335. .basicInfo_txt {
  336. margin-left: 40rpx;
  337. padding-top: 20rpx;
  338. }
  339. }
  340. .address {
  341. display: flex;
  342. margin: 30rpx 40rpx 0;
  343. padding: 30rpx 0;
  344. justify-content: space-around;
  345. .address_icon {
  346. vertical-align: middle;
  347. width: 50rpx;
  348. height: 50rpx;
  349. display: inline-block;
  350. padding-right: 30rpx;
  351. }
  352. .address_edit {}
  353. .address_edit image {
  354. vertical-align: middle;
  355. width: 50rpx;
  356. height: 50rpx;
  357. display: inline-block;
  358. padding-right: 14rpx;
  359. }
  360. .ipon {
  361. color: #333333;
  362. font-size: 32rpx;
  363. margin-bottom: 10rpx;
  364. }
  365. }
  366. .keyInfo {
  367. margin: 30rpx 40rpx;
  368. .keyInfo_task {
  369. color: #000;
  370. .keyInfo_task_txt {
  371. border-radius: 10rpx;
  372. }
  373. }
  374. }
  375. .keyInfo h3 {}
  376. .account {
  377. display: flex;
  378. align-items: center;
  379. width: 690rpx;
  380. padding: 24rpx 0;
  381. margin: 0 auto;
  382. .account_txt {
  383. display: inline-block;
  384. padding: 0 0 0 1%;
  385. width: 400rpx;
  386. }
  387. .account_txt span {
  388. color: #333333;
  389. font-weight: 550;
  390. text-indent: 2em;
  391. font-size: 32rpx;
  392. }
  393. .account_txt image {
  394. vertical-align: middle;
  395. width: 50rpx;
  396. height: 50rpx;
  397. display: inline-block;
  398. padding-right: 14rpx;
  399. }
  400. .account_fans {
  401. display: flex;
  402. width: 250rpx;
  403. }
  404. .account_fans p {
  405. display: inline-block;
  406. color: #333333;
  407. font-weight: 550;
  408. }
  409. .account_btn {}
  410. }
  411. .block {
  412. width: 100%;
  413. height: 100rpx;
  414. margin-top: 5%;
  415. }
  416. .submit {
  417. box-shadow: 0rpx 5rpx 40rpx #ccc;
  418. width: 100%;
  419. position: fixed;
  420. bottom: 0rpx;
  421. display: flex;
  422. height: 90rpx;
  423. padding-top: 2%;
  424. background-color: #FFFFFF;
  425. .submit_btn {
  426. width: 60%;
  427. background-color: #FCCF41;
  428. border-radius: 20rpx;
  429. font-size: 36rpx;
  430. line-height: 200%;
  431. letter-spacing: 10rpx;
  432. height: 80%;
  433. }
  434. }
  435. </style>