information.vue 11 KB

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